From cb9dc9926b02c8ef4bbc779223eb5b58476b8819 Mon Sep 17 00:00:00 2001 From: Joe R Date: Tue, 7 Dec 2021 20:13:41 -0500 Subject: [PATCH] Fix for misalignment of Shisen-Sho hint arrow. --- pysollib/game/__init__.py | 3 +++ pysollib/games/mahjongg/shisensho.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pysollib/game/__init__.py b/pysollib/game/__init__.py index 4aef54de..336d234d 100644 --- a/pysollib/game/__init__.py +++ b/pysollib/game/__init__.py @@ -532,6 +532,7 @@ class Game(object): self.sg = StackGroups() self.regions = StackRegions() self.init_size = (0, 0) + self.center_offset = (0, 0) self.event_handled = False # if click event handled by Stack (???) self.reset() @@ -1014,6 +1015,7 @@ class Game(object): else: xf, yf = self.app.opt.scale_x, self.app.opt.scale_y cw, ch = self.getCenterOffset(vw, vh, iw, ih, xf, yf) + self.center_offset = (cw, ch) if (not self.app.opt.spread_stacks or manually): # images self.app.images.resize(xf, yf) @@ -1045,6 +1047,7 @@ class Game(object): self.deleteStackDesc() xf, yf, xf0, yf0, cw, ch = \ self.resizeImages(manually=card_size_manually) + self.center_offset = (cw, ch) for stack in self.allstacks: if (self.app.opt.spread_stacks): diff --git a/pysollib/games/mahjongg/shisensho.py b/pysollib/games/mahjongg/shisensho.py index 0263a77c..839a15f4 100644 --- a/pysollib/games/mahjongg/shisensho.py +++ b/pysollib/games/mahjongg/shisensho.py @@ -250,7 +250,8 @@ class Shisen_RowStack(Mahjongg_RowStack): cs = game.app.cardset path = self.acceptsCards(other_stack, [other_stack.cards[-1]]) # print path - x0, y0 = game.XMARGIN, game.YMARGIN + x0, y0 = (game.XMARGIN + game.center_offset[0], + game.YMARGIN + game.center_offset[1]) cardw, cardh = images.CARDW, images.CARDH if cs.version >= 6: cardw -= cs.SHADOW_XOFFSET