X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/502113941da16d7949d8dfb8da0d39a0c3761975..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/osx/carbon/dcclient.cpp diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 0a257909e7..21f3c245bd 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -68,7 +68,9 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) if ( window->MacGetLeftBorderSize() != 0 || window->MacGetTopBorderSize() != 0 ) CGContextTranslateCTM( cg , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() ); - SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) ); + wxGraphicsContext* context = wxGraphicsContext::CreateFromNative( cg ); + context->EnableOffset(true); + SetGraphicsContext( context ); } DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; @@ -161,6 +163,8 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) : wxClientDCImpl::~wxClientDCImpl() { + if( GetGraphicsContext() && GetGraphicsContext()->GetNativeContext() ) + Flush(); } /* @@ -181,10 +185,6 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) : wxPoint origin = window->GetClientAreaOrigin() ; m_window->GetClientSize( &m_width , &m_height); SetDeviceOrigin( origin.x, origin.y ); -#ifdef __WXOSX_IPHONE__ - m_graphicContext->ResetClip(); - m_clipping = false; -#endif DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; }