summaryrefslogtreecommitdiff
path: root/delegate_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-03 17:44:03 -0500
committerPietro Gagliardi <[email protected]>2014-03-03 17:44:03 -0500
commit962a84e056fd524ed458391961510a1c32892895 (patch)
tree515e6e1b6ad5662b99291f8132edc2afd9ca6e91 /delegate_darwin.go
parent6c3389283138cb4baf5ccc3d5785c318e376f26f (diff)
Fixed Mac OS X control placement flipping. This is done by passing the height of the window around setRect() calls to avoid polling the content view frame each time.
Diffstat (limited to 'delegate_darwin.go')
-rw-r--r--delegate_darwin.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/delegate_darwin.go b/delegate_darwin.go
index 897cc28..82c536d 100644
--- a/delegate_darwin.go
+++ b/delegate_darwin.go
@@ -88,7 +88,8 @@ func appDelegate_windowDidResize(self C.id, sel C.SEL, notification C.id) {
wincv := C.objc_msgSend_noargs(win, _contentView) // we want the content view's size, not the window's; selector defined in sysdata_darwin.go
r := C.objc_msgSend_stret_rect_noargs(wincv, _frame)
if sysData.resize != nil {
- err := sysData.resize(int(r.x), int(r.y), int(r.width), int(r.height))
+ // winheight is used here because (0,0) is the bottom-left corner, not the top-left corner
+ err := sysData.resize(int(r.x), int(r.y), int(r.width), int(r.height), int(r.height))
if err != nil {
panic("child resize failed: " + err.Error())
}