From 94929e7b60de96bd3b064984ae8995d665329411 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 17 Jan 2009 18:58:05 +0000 Subject: [PATCH] fixing screen coordinate transformation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/nonownedwnd.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 6e270ee826..20a01d1834 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -22,7 +22,7 @@ NSRect wxToNSRect( NSView* parent, const wxRect& r ) NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame]; int y = r.y; int x = r.x ; - if ( parent != NULL && ![ parent isFlipped ] ) + if ( parent == NULL || ![ parent isFlipped ] ) y = frame.size.height - ( r.y + r.height ); return NSMakeRect(x, y, r.width , r.height); } @@ -32,7 +32,7 @@ wxRect wxFromNSRect( NSView* parent, const NSRect& rect ) NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame]; int y = rect.origin.y; int x = rect.origin.x; - if ( parent != NULL && ![ parent isFlipped ] ) + if ( parent == NULL || ![ parent isFlipped ] ) y = frame.size.height - (rect.origin.y + rect.size.height); return wxRect( x, y, rect.size.width, rect.size.height ); } @@ -42,7 +42,7 @@ NSPoint wxToNSPoint( NSView* parent, const wxPoint& p ) NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame]; int x = p.x ; int y = p.y; - if ( parent != NULL && ![ parent isFlipped ] ) + if ( parent == NULL || ![ parent isFlipped ] ) y = frame.size.height - ( p.y ); return NSMakePoint(x, y); } @@ -52,7 +52,7 @@ wxPoint wxFromNSPoint( NSView* parent, const NSPoint& p ) NSRect frame = parent ? [parent bounds] : [[NSScreen mainScreen] frame]; int x = p.x; int y = p.y; - if ( parent != NULL && ![ parent isFlipped ] ) + if ( parent == NULL || ![ parent isFlipped ] ) y = frame.size.height - ( p.y ); return wxPoint( x, y); } -- 2.47.2