X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd04970ab45eb2f392af48b71aa9ecd5d4b1c8c2..0e05227246cc99b2f8133ae639f38c508351afa0:/src/mac/carbon/dcprint.cpp diff --git a/src/mac/carbon/dcprint.cpp b/src/mac/carbon/dcprint.cpp index 3e23605ef7..a7d3de26e9 100644 --- a/src/mac/carbon/dcprint.cpp +++ b/src/mac/carbon/dcprint.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "dcprint.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -180,8 +176,11 @@ void wxMacCarbonPrinterDC::StartPage( wxPrinterDC* dc ) if ( !m_err ) { #if wxMAC_USE_CORE_GRAPHICS - CGContextTranslateCTM( pageContext , 0 , rPage.bottom - rPage.top ) ; + PMRect paperRect ; + 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 +230,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 ; }