]> git.saurik.com Git - wxWidgets.git/commitdiff
save correctly oriented GraphicState and clear Context before destruction (is invalid...
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 27 Aug 2005 13:55:49 +0000 (13:55 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 27 Aug 2005 13:55:49 +0000 (13:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dcprint.cpp

index 3e23605ef79af14c07c187a3e1d64a84007f165b..87f5ec2ad44e3c61837176caa742cbb4895c47c6 100644 (file)
@@ -182,6 +182,7 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc )
 #if wxMAC_USE_CORE_GRAPHICS
             CGContextTranslateCTM( pageContext , 0 , rPage.bottom - rPage.top ) ;
             CGContextScaleCTM( pageContext , 1 , -1 ) ;
+            CGContextSaveGState( pageContext ) ;
 #else
             dc->m_macLocalOrigin.x = (int) rPage.left;
             dc->m_macLocalOrigin.y = (int) rPage.top;
@@ -231,6 +232,10 @@ wxPrinterDC::wxPrinterDC(const wxPrintData& printdata)
 
 wxPrinterDC::~wxPrinterDC(void)
 {
+#if wxMAC_USE_CORE_GRAPHICS
+    // this context was borrowed
+    ((wxMacCGContext*)(m_graphicContext))->SetNativeContext( NULL ) ;
+#endif
     delete m_nativePrinterDC ;
 }