X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/carbon/dcclient.cpp diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 663640741c..97929e1093 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -58,6 +58,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) if ( cg == NULL ) { SetGraphicsContext( wxGraphicsContext::Create( window ) ) ; + SetDeviceOrigin(-window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize()); } else { @@ -68,7 +69,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 ) ; @@ -155,12 +158,18 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) : m_window->GetClientSize( &m_width , &m_height); if ( !m_window->IsShownOnScreen() ) m_width = m_height = 0; - SetDeviceOrigin( origin.x, origin.y ); + + int x0,y0; + DoGetDeviceOrigin(&x0,&y0); + SetDeviceOrigin( origin.x + x0, origin.y + y0 ); + DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; } wxClientDCImpl::~wxClientDCImpl() { + if( GetGraphicsContext() && GetGraphicsContext()->GetNativeContext() ) + Flush(); } /*