]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/renderer.cpp
on demand creation of native CGContexts , so that pure text measuring contexts don...
[wxWidgets.git] / src / mac / carbon / renderer.cpp
index 802ff8a81e08d6b2c29a86e5c7686168553b537e..c9c3904f5c60c0213397bc58018868e177b92c9f 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include "wx/renderer.h"
+#include "wx/graphics.h"
 #include "wx/mac/uma.h"
 
 
@@ -133,10 +134,10 @@ void wxRendererMac::DrawHeaderButton( wxWindow *win,
     wxHeaderSortIconType sortArrow,
     wxHeaderButtonParams* params )
 {
-    const wxCoord x = dc.XLOG2DEV(rect.x /*- 1*/);
-    const wxCoord y = dc.YLOG2DEV(rect.y /*- 1*/);
-    const wxCoord w = dc.XLOG2DEVREL(rect.width);
-    const wxCoord h = dc.YLOG2DEVREL(rect.height);
+    const wxCoord x = dc.LogicalToDeviceX(rect.x /*- 1*/);
+    const wxCoord y = dc.LogicalToDeviceY(rect.y /*- 1*/);
+    const wxCoord w = dc.LogicalToDeviceXRel(rect.width);
+    const wxCoord h = dc.LogicalToDeviceYRel(rect.height);
 
     dc.SetBrush( *wxTRANSPARENT_BRUSH );
 
@@ -160,7 +161,7 @@ void wxRendererMac::DrawHeaderButton( wxWindow *win,
         CGContextRef cgContext;
 
 #if wxMAC_USE_CORE_GRAPHICS
-        cgContext = ((wxMacCGContext*)(dc.GetGraphicContext()))->GetNativeContext();
+        cgContext = (CGContextRef) dc.GetGraphicsContext()->GetNativeContext();
 #else
         Rect bounds;
 
@@ -329,7 +330,7 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win,
         CGContextRef cgContext;
 
 #if wxMAC_USE_CORE_GRAPHICS
-        cgContext = ((wxMacCGContext*)(dc.GetGraphicContext()))->GetNativeContext();
+        cgContext = (CGContextRef) dc.GetGraphicsContext()->GetNativeContext();
 #else
         Rect bounds;
         GetPortBounds( (CGrafPtr) dc.m_macPort, &bounds );