make sure we always restore the passed in cg in a paint event

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-10-31 08:39:08 +00:00
parent 477bfb0a7e
commit 35ee712487

View File

@@ -165,11 +165,12 @@ wxWindowDC::wxWindowDC(wxWindow *window)
wxWindowDC::~wxWindowDC() wxWindowDC::~wxWindowDC()
{ {
#if wxMAC_USE_CORE_GRAPHICS #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(); CGContextRef cg = (CGContextRef) m_window->MacGetCGContextRef();
CGContextRestoreGState(cg); CGContextRestoreGState(cg);
//CGContextRef cg = (CGContextRef) m_graphicContext->GetNativeContext() ;
} }
#endif #endif
} }