From: Stefan Csomor Date: Tue, 31 Oct 2006 08:39:08 +0000 (+0000) Subject: make sure we always restore the passed in cg in a paint event X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/35ee7124870ad4b8f73b45d906209620e36ae9ea 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 --- diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp index 7023f8cc9f..3fab6f98e2 100644 --- a/src/mac/carbon/dcclient.cpp +++ b/src/mac/carbon/dcclient.cpp @@ -165,11 +165,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 }