From db720f0079eabe14b54a4da9ebb662deb9ac1bbd Mon Sep 17 00:00:00 2001 From: Joe R Date: Sat, 21 Aug 2021 20:05:39 -0400 Subject: [PATCH] Updated text display alignment for a few games. --- pysollib/games/acesandkings.py | 30 ++++++++++++++++-------------- pysollib/games/canfield.py | 2 +- pysollib/games/fan.py | 6 +++--- pysollib/games/pushpin.py | 2 +- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/pysollib/games/acesandkings.py b/pysollib/games/acesandkings.py index 9bab711c..5308b7b9 100644 --- a/pysollib/games/acesandkings.py +++ b/pysollib/games/acesandkings.py @@ -86,13 +86,14 @@ class AcesAndKings(Game): stack = AcesAndKings_FoundationStack(x, y, self, suit=j, base_rank=i[0], dir=1, max_cards=(13 - i[0])) - stack.texts.misc = MfxCanvasText(self.canvas, - x + l.CW // 2, - y + l.CH // 2, - anchor="center", - font=font) - stack.texts.misc.config(text=(RANKS[i[0]][0])) - s.foundations.append(stack) + if self.preview <= 1: + stack.texts.misc = MfxCanvasText(self.canvas, + x + l.CW // 2, + y + l.CH // 2, + anchor="center", + font=font) + stack.texts.misc.config(text=(RANKS[i[0]][0])) + s.foundations.append(stack) x = x + l.XS x = x + (l.XS / 2) @@ -100,13 +101,14 @@ class AcesAndKings(Game): stack = AcesAndKings_FoundationStack(x, y, self, suit=j, base_rank=i[1], dir=-1, max_cards=(i[1] + 1)) - stack.texts.misc = MfxCanvasText(self.canvas, - x + l.CW // 2, - y + l.CH // 2, - anchor="center", - font=font) - stack.texts.misc.config(text=(RANKS[i[1]][0])) - s.foundations.append(stack) + if self.preview <= 1: + stack.texts.misc = MfxCanvasText(self.canvas, + x + l.CW // 2, + y + l.CH // 2, + anchor="center", + font=font) + stack.texts.misc.config(text=(RANKS[i[1]][0])) + s.foundations.append(stack) x = x + l.XS x, y = l.XM, y + l.YS diff --git a/pysollib/games/canfield.py b/pysollib/games/canfield.py index 19036d67..d00585cc 100644 --- a/pysollib/games/canfield.py +++ b/pysollib/games/canfield.py @@ -132,7 +132,7 @@ class Canfield(Game): tx, ty, ta, tf = lay.getTextAttr(None, "se") tx, ty = x + tx + lay.XM, y + ty else: - tx, ty, ta, tf = lay.getTextAttr(None, "ss") + tx, ty, ta, tf = lay.getTextAttr(None, "s") tx, ty = x + tx, y + ty font = self.app.getFont("canvas_default") self.texts.info = MfxCanvasText(self.canvas, tx, ty, diff --git a/pysollib/games/fan.py b/pysollib/games/fan.py index 7937bea3..8e889228 100644 --- a/pysollib/games/fan.py +++ b/pysollib/games/fan.py @@ -735,11 +735,11 @@ class Crescent(Game): l, s = Layout(self), self.s playcards = 10 w0 = l.XS+(playcards-1)*l.XOFFSET - w, h = l.XM+max(4*w0, 9*l.XS), l.YM+5*l.YS + w, h = l.XM+max(4*w0, 9*l.XS), l.YM + 5 * l.YS + l.TEXT_HEIGHT self.setSize(w, h) x, y = l.XM, l.YM s.talon = Crescent_Talon(x, y, self, max_rounds=4) - l.createRoundText(s.talon, 'ne') + l.createRoundText(s.talon, 's') x, y = w-8*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) @@ -748,7 +748,7 @@ class Crescent(Game): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, base_rank=KING, dir=-1)) x += l.XS - y = l.YM+l.YS + y = l.YM + l.YS + l.TEXT_HEIGHT for i in range(4): x = l.XM for j in range(4): diff --git a/pysollib/games/pushpin.py b/pysollib/games/pushpin.py index 48531efa..ad3af5a4 100644 --- a/pysollib/games/pushpin.py +++ b/pysollib/games/pushpin.py @@ -138,7 +138,7 @@ class PushPin(Game): pad = 1 if self.Comment: - pad = 5 + pad = l.TEXT_HEIGHT # set window xx, yy = 9, 6