1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Fix for misalignment of Shisen-Sho hint arrow.

This commit is contained in:
Joe R 2021-12-07 20:13:41 -05:00
parent db1bd0f048
commit cb9dc9926b
2 changed files with 5 additions and 1 deletions

View file

@ -532,6 +532,7 @@ class Game(object):
self.sg = StackGroups() self.sg = StackGroups()
self.regions = StackRegions() self.regions = StackRegions()
self.init_size = (0, 0) self.init_size = (0, 0)
self.center_offset = (0, 0)
self.event_handled = False # if click event handled by Stack (???) self.event_handled = False # if click event handled by Stack (???)
self.reset() self.reset()
@ -1014,6 +1015,7 @@ class Game(object):
else: else:
xf, yf = self.app.opt.scale_x, self.app.opt.scale_y xf, yf = self.app.opt.scale_x, self.app.opt.scale_y
cw, ch = self.getCenterOffset(vw, vh, iw, ih, xf, yf) cw, ch = self.getCenterOffset(vw, vh, iw, ih, xf, yf)
self.center_offset = (cw, ch)
if (not self.app.opt.spread_stacks or manually): if (not self.app.opt.spread_stacks or manually):
# images # images
self.app.images.resize(xf, yf) self.app.images.resize(xf, yf)
@ -1045,6 +1047,7 @@ class Game(object):
self.deleteStackDesc() self.deleteStackDesc()
xf, yf, xf0, yf0, cw, ch = \ xf, yf, xf0, yf0, cw, ch = \
self.resizeImages(manually=card_size_manually) self.resizeImages(manually=card_size_manually)
self.center_offset = (cw, ch)
for stack in self.allstacks: for stack in self.allstacks:
if (self.app.opt.spread_stacks): if (self.app.opt.spread_stacks):

View file

@ -250,7 +250,8 @@ class Shisen_RowStack(Mahjongg_RowStack):
cs = game.app.cardset cs = game.app.cardset
path = self.acceptsCards(other_stack, [other_stack.cards[-1]]) path = self.acceptsCards(other_stack, [other_stack.cards[-1]])
# print path # 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 cardw, cardh = images.CARDW, images.CARDH
if cs.version >= 6: if cs.version >= 6:
cardw -= cs.SHADOW_XOFFSET cardw -= cs.SHADOW_XOFFSET