X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e686aa37b5fee41ed7017e47a66a6829d66e452d..43a302f200f1e9f5f21380bbc7ba74ad8c22d6d6:/src/mac/carbon/overlay.cpp?ds=inline diff --git a/src/mac/carbon/overlay.cpp b/src/mac/carbon/overlay.cpp index 1a03d6e1a8..3ae300276a 100644 --- a/src/mac/carbon/overlay.cpp +++ b/src/mac/carbon/overlay.cpp @@ -135,22 +135,21 @@ void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height ) void wxOverlayImpl::BeginDrawing( wxDC* dc) { wxDCImpl *impl = dc->GetImpl(); - wxWindowDCImpl *win_impl = wxDynamicCast(impl,wxWindowDCImpl); + wxGCDCImpl *win_impl = wxDynamicCast(impl,wxGCDCImpl); if (win_impl) { win_impl->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) ); - wxSize size = dc->GetSize() ; - dc->SetClippingRegion( 0 , 0 , size.x , size.y ) ; + dc->SetClippingRegion( m_x , m_y , m_width , m_height ) ; } } void wxOverlayImpl::EndDrawing( wxDC* dc) { wxDCImpl *impl = dc->GetImpl(); - wxWindowDCImpl *win_impl = wxDynamicCast(impl,wxWindowDCImpl); + wxGCDCImpl *win_impl = wxDynamicCast(impl,wxGCDCImpl); if (win_impl) win_impl->SetGraphicsContext(NULL); - + CGContextFlush( m_overlayContext ); } @@ -167,7 +166,10 @@ void wxOverlayImpl::Reset() { #ifndef __LP64__ OSStatus err = QDEndCGContext(GetWindowPort(m_overlayWindow), &m_overlayContext); - wxASSERT_MSG( err == noErr , _("Couldn't end the context on the overlay window") ); + if ( err != noErr ) + { + wxFAIL_MSG("Couldn't end the context on the overlay window"); + } #endif m_overlayContext = NULL ; }