Skip to content

Commit

Permalink
Kivy/Android:
Browse files Browse the repository at this point in the history
- zoom: card selection improved (bug fix)
  • Loading branch information
lufebe16 committed Nov 27, 2024
1 parent f844c0e commit 289df06
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Binary file modified locale/pl/LC_MESSAGES/pysol.mo
Binary file not shown.
Binary file modified locale/pt_BR/LC_MESSAGES/pysol.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion pysollib/kivy/LObjWrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,obj,ref=None,command=None):
self.bind(value=command)

def on_value(self,inst,val):
logging.info("LObjWrap: %s = %s" % (self.ref,val))
# logging.info("LObjWrap: %s = %s" % (self.ref,val))
if self.ref is not None:
setattr(self.obj,self.ref,val)

Expand Down
12 changes: 11 additions & 1 deletion pysollib/kivy/tkwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def __init__(self, inner, **kw):
self.scale_min = 1.0
self.scale_max = 2.2
self.lock_pos = None
self.lock_chk = None
self.offset = None
self.tkopt = None

Expand Down Expand Up @@ -420,8 +421,10 @@ def _update(self):
dx = round(self.offset[0] * (self.bbox[1][0] - self.size[0]))
dy = round(self.offset[1] * (self.bbox[1][1] - self.size[1]))
self.pos = (self.parent.pos[0]-dx,self.parent.pos[1]-dy)
if self.lock_chk is None:
Clock.schedule_once(lambda dt: self.chk_bnd()) # noqa
self.lock_pos = None
print("_update",self.pos,self.size)
# print("_update",self.pos,self.size)

def _updatesize(self,instance,value):
self.inner.size = self.size
Expand Down Expand Up @@ -466,6 +469,10 @@ def on_transform_with_touch(self,touch):
def chk_bnd(self):
# Keep the game on the screen.

# check and set lock
if self.lock_chk is not None: return
self.lock_chk = "locked"

# limiting parameters:
pos,size = self.bbox
w,h = size
Expand Down Expand Up @@ -502,6 +509,9 @@ def chk_bnd(self):
zoominfo = [zoom, 0.0, 0.0]
self.tkopt.table_zoom.value = zoominfo

# remove lock
self.lock_chk = None


class LScrollFrame(BoxLayout,StencilView):
def __init__(self, **kw):
Expand Down

0 comments on commit 289df06

Please sign in to comment.