]> git.saurik.com Git - wxWidgets.git/commitdiff
casing the coordinates recalc
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 1 Nov 2006 06:07:11 +0000 (06:07 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 1 Nov 2006 06:07:11 +0000 (06:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/renderer.cpp

index aac95cbb8331afb17445dd20afa4115de4b63643..6a71a90efb72bf0b4d34dff2405126dad67c0455 100644 (file)
@@ -82,10 +82,18 @@ void wxRendererMac::DrawHeaderButton( wxWindow *win,
     wxHeaderSortIconType sortArrow,
     wxHeaderButtonParams* params )
 {
-    const wxCoord x = dc.LogicalToDeviceX(rect.x /*- 1*/);
-    const wxCoord y = dc.LogicalToDeviceY(rect.y /*- 1*/);
+##if !wxMAC_USE_CORE_GRAPHICS
+    const wxCoord x = dc.LogicalToDeviceX(rect.x);
+    const wxCoord y = dc.LogicalToDeviceY(rect.y);
     const wxCoord w = dc.LogicalToDeviceXRel(rect.width);
     const wxCoord h = dc.LogicalToDeviceYRel(rect.height);
+#else
+    // now the wxGCDC is using native transformations
+    const wxCoord x = rect.x;
+    const wxCoord y = rect.y;
+    const wxCoord w = rect.width;
+    const wxCoord h = rect.height;
+#endif
 
     dc.SetBrush( *wxTRANSPARENT_BRUSH );
 
@@ -192,18 +200,19 @@ void wxRendererMac::DrawTreeItemButton( wxWindow *win,
     const wxRect& rect,
     int flags )
 {
-#if 0  // The rect has already been adjusted, if that ever changes then uncomment this code.
-    const wxCoord x = dc.LogicalToDeviceX(rect.x /*- 1*/);
-    const wxCoord y = dc.LogicalToDeviceY(rect.y /*- 1*/);
+#if !wxMAC_USE_CORE_GRAPHICS
+    const wxCoord x = dc.LogicalToDeviceX(rect.x);
+    const wxCoord y = dc.LogicalToDeviceY(rect.y);
     const wxCoord w = dc.LogicalToDeviceXRel(rect.width);
     const wxCoord h = dc.LogicalToDeviceYRel(rect.height);
 #else
+    // now the wxGCDC is using native transformations
     const wxCoord x = rect.x;
     const wxCoord y = rect.y;
     const wxCoord w = rect.width;
     const wxCoord h = rect.height;
 #endif    
-    
+
     dc.SetBrush( *wxTRANSPARENT_BRUSH );
 
     HIRect headerRect = CGRectMake( x, y, w, h );