diff --git a/area_windows.go b/area_windows.go index 5f41790..235a5a3 100644 --- a/area_windows.go +++ b/area_windows.go @@ -77,6 +77,7 @@ func paintArea(s *sysData) { hscroll, vscroll := getScrollPos(s.hwnd) + // both Windows RECT and Go image.Rect are point..point, so the following is correct cliprect := image.Rect(int(xrect.left), int(xrect.top), int(xrect.right), int(xrect.bottom)) cliprect = cliprect.Add(image.Pt(int(hscroll), int(vscroll))) // adjust by scroll position // make sure the cliprect doesn't fall outside the size of the Area diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index df7aef8..c36b9fe 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -158,7 +158,7 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL panic("GetClientRect failed: " + err.Error()) } // top-left corner is (0,0) so no need for winheight - s.doResize(int(r.left), int(r.top), int(r.right), int(r.bottom), 0) + s.doResize(int(r.left), int(r.top), int(r.right - r.left), int(r.bottom - r.top), 0) // TODO use the Defer movement functions here? // TODO redraw window and all children here? } diff --git a/todo.md b/todo.md index 96976a0..a35ef73 100644 --- a/todo.md +++ b/todo.md @@ -7,7 +7,6 @@ MAC OS X: WINDOWS: - windows: windows key handling is just wrong; figure out how to avoid (especially since Windows intercepts that key by default) - redrawing controls after a window resize on Windows does not work properly -- check all uses of RECT.right/.bottom in Windows that don't have an accompanying -RECT.left/.top to make sure they're correct - when adding IsDialogMessage() find out if that make sthe area in the area bounds test automatically focused UNIX: