]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing screen coordinate transformation
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 17 Jan 2009 18:58:05 +0000 (18:58 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 17 Jan 2009 18:58:05 +0000 (18:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/nonownedwnd.mm

index 6e270ee8266b5ec19e1c84ccd44d4e7e13042c60..20a01d183409b77e20d1c692700044bc1a440bd7 100644 (file)
@@ -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);
 }