Skip to content

Commit 8e1c682

Browse files
committed
Convert height and width values (see #537)
1 parent 7a6b873 commit 8e1c682

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pysollib/ui/tktile/tkcanvas.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def moveTo(self, x, y):
122122
class MfxCanvas(tkinter.Canvas):
123123
def __init__(self, *args, **kw):
124124
tkinter.Canvas.__init__(self, *args, **kw)
125+
# print(self.cget('width'))
125126
self.preview = 0
126127
self.busy = False
127128
# this is also used by lib-tk/Canvas.py
@@ -200,10 +201,10 @@ def setBackgroundImage(self, event=None):
200201
def _geometry(self):
201202
w = self.winfo_width()
202203
if w == 1:
203-
w = int(self.cget('width'))
204+
w = int(self.winfo_fpixels(self.cget('width')))
204205
h = self.winfo_height()
205206
if h == 1:
206-
h = int(self.cget('height'))
207+
h = int(self.winfo_fpixels(self.cget('height')))
207208
scrollregion = self.cget('scrollregion')
208209
if not scrollregion:
209210
return w, h

0 commit comments

Comments
 (0)