diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-08-08 18:56:39 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-08-08 18:56:39 (GMT) |
commit | ee6f36ad4adf6a30ba2ddf03b78fb999fea8d6bb (patch) | |
tree | c40ef70802c252ead69276b9bdd599bc39785f83 | |
parent | 2878121e4888d6e1b5383e3c27cf8a46f67a290f (diff) |
Improve use of vertical size in the screen
-rw-r--r-- | dominogame.py | 2 | ||||
-rw-r--r-- | dominoview.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/dominogame.py b/dominogame.py index 1f18608..c8c5003 100644 --- a/dominogame.py +++ b/dominogame.py @@ -151,7 +151,7 @@ class DominoGame: separacion_x = int((dominoview.SCREEN_WIDTH - dominoview.SIZE * len(pieces)) / len(pieces)) x = separacion_x / 2 - y = self.table.limitTable + 5 + y = self.table.limitTable + dominoview.SIZE / 2 for piece in pieces: piece.x = x diff --git a/dominoview.py b/dominoview.py index 9949d7e..3987bb4 100644 --- a/dominoview.py +++ b/dominoview.py @@ -13,13 +13,15 @@ from gettext import gettext as _ import cairoutils +from sugar3.graphics import style + # SIZE Es el ancho de una ficha (y la mitads del largo) # podemos imaginar el tablero dividido en cuadrados de lado SIZE SIZE = 60 # Si se quiere usar fichas mas grandes, se puede usar SIZE = 70 y # cambiar _drawLabel el scale = 3 -SCREEN_HEIGHT = Gdk.Screen.height() +SCREEN_HEIGHT = Gdk.Screen.height() - style.GRID_CELL_SIZE SCREEN_WIDTH = Gdk.Screen.width() @@ -57,7 +59,7 @@ class DominoTableView(): def __init__(self, **kwargs): self.cantX = int(SCREEN_WIDTH / SIZE) - 1 - self.cantY = int((SCREEN_HEIGHT - (SIZE*3.5)) / SIZE) + self.cantY = int((SCREEN_HEIGHT - SIZE * 3) / SIZE) self.margenX = int((SCREEN_WIDTH - SIZE * self.cantX) / 2) self.limitTable = SIZE * self.cantY print "Table cantX", self.cantX, "cantY", self.cantY |