]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dcclient.cpp
Switching to a keyed list for storing information about the column data in each row...
[wxWidgets.git] / src / mac / carbon / dcclient.cpp
index 7023f8cc9f237e3ab49a57e2c7a1e58b9f458e4a..9fcd763bb8548e9ee2f607705d9328fa28b777d7 100644 (file)
@@ -112,6 +112,9 @@ static wxBrush MacGetBackgroundBrush( wxWindow* window )
 wxWindowDC::wxWindowDC()
 {
     m_window = NULL ;
+#if wxMAC_USE_CORE_GRAPHICS
+    m_release = false;
+#endif
 }
 
 wxWindowDC::wxWindowDC(wxWindow *window)
@@ -142,8 +145,6 @@ wxWindowDC::wxWindowDC(wxWindow *window)
 
         SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) );
     }
-    m_graphicContext->SetPen( m_pen ) ;
-    m_graphicContext->SetBrush( m_brush ) ;
     SetClippingRegion( 0 , 0 , m_width , m_height ) ;
 #else
     int x , y ;
@@ -165,11 +166,12 @@ wxWindowDC::wxWindowDC(wxWindow *window)
 wxWindowDC::~wxWindowDC()
 {
 #if wxMAC_USE_CORE_GRAPHICS
-    if ( m_release && m_graphicContext )
+    if ( m_release )
     {
+        // this must not necessarily be the current context, we must restore the state of the
+        // cg we started with above (before the CGContextTranslateCTM call)
         CGContextRef cg = (CGContextRef) m_window->MacGetCGContextRef();
         CGContextRestoreGState(cg);
-        //CGContextRef cg = (CGContextRef) m_graphicContext->GetNativeContext() ;
     }
 #endif
 }