]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
positioning of the insertion point at the end
[wxWidgets.git] / src / mac / carbon / window.cpp
index 37293231dbd56cd342d9feb5b3731fb2fdc61386..88c4356480efc6a168cb6935521744d474f42579 100644 (file)
@@ -1587,9 +1587,14 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const
     GetRegionBounds( rgn , &content ) ;
     DisposeRgn( rgn ) ;
 #if !TARGET_API_MAC_OSX
-    Rect structure ;
-    GetControlBounds( (ControlRef) m_macControl , &structure ) ;
-    OffsetRect( &content , -structure.left , -structure.top ) ;
+    // if the content rgn is empty / not supported
+    // don't attempt to correct the coordinates to wxWindow relative ones
+    if (!::EmptyRect( &content ) )
+    {
+        Rect structure ;
+        GetControlBounds( (ControlRef) m_macControl , &structure ) ;
+        OffsetRect( &content , -structure.left , -structure.top ) ;
+    }
 #endif 
 
     return wxPoint( content.left + MacGetLeftBorderSize(  ) , content.top + MacGetTopBorderSize(  ) );