X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f87a708b143329a5b7f4e18e88967853c553082d..965784669a9655410c38e306f264738d71907d95:/src/mac/dc.cpp?ds=inline diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index 8285afd1c6..81a990bfd6 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -103,9 +103,25 @@ wxDC::~wxDC(void) void wxDC::MacSetupPort(AGAPortHelper* help) const { - help->Setup( m_macPort ) ; +// help->Setup( m_macPort ) ; ::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v); - ::ClipRect(&m_macClipRect); + + if ( m_clipping ) + { + long x1 = XLOG2DEV(m_clipX1); + long y1 = YLOG2DEV(m_clipY1); + long x2 = XLOG2DEV(m_clipX2); + long y2 = YLOG2DEV(m_clipY2); + + Rect clip = { y1 , x1 , y2 , x2 } ; + ::SectRect( &clip , &m_macClipRect , &clip ) ; + ::ClipRect( &clip ) ; + } + else + { + ::ClipRect(&m_macClipRect); + } + m_macFontInstalled = false ; m_macBrushInstalled = false ; @@ -206,7 +222,6 @@ void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ) void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) { - wxMacPortSetter helper(this) ; if( m_clipping ) { m_clipX1 = wxMax( m_clipX1 , x ) ; @@ -223,17 +238,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei m_clipX2 = x + width; m_clipY2 = y + height; } - - long x1 = XLOG2DEV(m_clipX1); - long y1 = YLOG2DEV(m_clipY1); - long x2 = XLOG2DEV(m_clipX2); - long y2 = YLOG2DEV(m_clipY2); - - Rect clip = { y1 , x1 , y2 , x2 } ; - - ::ClipRect( &clip ) ; - -}; + }; void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) { @@ -255,8 +260,6 @@ void wxDC::DestroyClippingRegion(void) { wxMacPortSetter helper(this) ; m_clipping = FALSE; -// Rect clip = { -32000 , -32000 , 32000 , 32000 } ; - ::ClipRect(&m_macClipRect); }; void wxDC::DoGetSize( int* width, int* height ) const