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

Skip to content

Commit ee8662f

Browse files
committed
Fixed viewrect/destrect calculation
1 parent e57c96e commit ee8662f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Mac/Demo/textedit/ped.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ def open(self, path, name, data):
2121
r = windowbounds(400, 400)
2222
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
2323
self.wid = w
24-
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15
25-
dr = (0, 0, vr[2], 0)
24+
x0, y0, x1, y1 = self.wid.GetWindowPort().portRect
25+
x0 = x0 + 4
26+
y0 = y0 + 4
27+
x1 = x1 - 20
28+
y1 = y1 - 20
29+
vr = dr = x0, y0, x1, y1
30+
##vr = 4, 0, r[2]-r[0]-15, r[3]-r[1]-15
31+
##dr = (0, 0, vr[2], 0)
2632
Qd.SetPort(w)
2733
Qd.TextFont(4)
2834
Qd.TextSize(9)

0 commit comments

Comments
 (0)