Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38a5a3b

Browse files
committed
Use only the height to decide whether to zoom in or out.
1 parent 7890203 commit 38a5a3b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Tools/idle/ZoomHeight.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ def zoom_height_event(self, event):
2929
top.bell()
3030
return
3131
width, height, x, y = map(int, m.groups())
32-
height = top.winfo_screenheight()
32+
newheight = top.winfo_screenheight()
3333
if sys.platform == 'win32':
34-
y = 0
35-
height = height - 72
34+
newy = 0
35+
newheight = newheight - 72
3636
else:
37-
y = 24
38-
height = height - 96
39-
newgeom = "%dx%d+%d+%d" % (width, height, x, y)
40-
if geom == newgeom:
37+
newy = 24
38+
newheight = newheight - 96
39+
if height >= newheight:
4140
newgeom = ""
41+
else:
42+
newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
4243
top.wm_geometry(newgeom)

0 commit comments

Comments
 (0)