]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dcprint.cpp
wxCoordRound() -> wxRound()
[wxWidgets.git] / src / mac / carbon / dcprint.cpp
index fc24e02e6638c54bc7c01a386c24723bc6279d55..34af3cc1cbb61dab5181b05aa314be9883bb0254 100644 (file)
@@ -197,7 +197,6 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc )
                                             kPMGraphicsContextCoreGraphics,
                                             (void**) &pageContext );
 #endif
-        dc->MacSetCGContext(pageContext) ;
 #else
         m_err = PMSessionGetGraphicsContext(native->m_macPrintSession,
                                             kPMGraphicsContextQuickdraw,
@@ -222,7 +221,6 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc )
             PMGetAdjustedPaperRect( native->m_macPageFormat , &paperRect ) ;
             CGContextTranslateCTM( pageContext , -paperRect.left , -paperRect.top + ( 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 +229,9 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc )
         // since this is a non-critical error, we set the flag back
         m_err = noErr ;
     }
+#if wxMAC_USE_CORE_GRAPHICS
+    dc->MacSetCGContext(pageContext) ;
+#endif
 }
 
 void wxMacCarbonPrinterDC::EndPage( wxPrinterDC* dc )
@@ -245,6 +246,9 @@ void wxMacCarbonPrinterDC::EndPage( wxPrinterDC* dc )
     {
         PMSessionEndDocument(native->m_macPrintSession);
     }
+#if wxMAC_USE_CORE_GRAPHICS
+    dc->MacSetCGContext(NULL) ;
+#endif
 }
 
 void wxMacCarbonPrinterDC::GetSize( int *w , int *h) const