From 8c8b642adbed274133b6e9d975c7ca8786300d2c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 18 Oct 2014 17:02:51 -0400 Subject: Fixed Mac OS X sizing and more TODOs. Ready to merge back! --- newctrl/container_darwin.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'newctrl/container_darwin.m') diff --git a/newctrl/container_darwin.m b/newctrl/container_darwin.m index c5a50e1..1dfa7cb 100644 --- a/newctrl/container_darwin.m +++ b/newctrl/container_darwin.m @@ -34,7 +34,14 @@ id newContainerView(void *gocontainer) void moveControl(id c, intptr_t x, intptr_t y, intptr_t width, intptr_t height) { - [toNSView(c) setFrame:NSMakeRect((CGFloat) x, (CGFloat) y, (CGFloat) width, (CGFloat) height)]; + NSView *v; + NSRect frame; + + frame = NSMakeRect((CGFloat) x, (CGFloat) y, (CGFloat) width, (CGFloat) height); + // mac os x coordinate system has (0,0) in the lower-left + v = toNSView(c); + frame.origin.y = ([[v superview] bounds].size.height - frame.size.height) - frame.origin.y; + [v setFrame:frame]; } struct xrect containerBounds(id view) -- cgit v1.2.3