clip region fix backported for fast port setter

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-09-18 11:35:32 +00:00
parent 0e3585e9b8
commit c1cdbd128c
2 changed files with 12 additions and 0 deletions

View File

@@ -71,15 +71,21 @@ public :
wxASSERT( dc->Ok() ) ; wxASSERT( dc->Ok() ) ;
GetPort( &m_oldPort ) ; GetPort( &m_oldPort ) ;
SetPort( (GrafPtr) dc->m_macPort ) ; SetPort( (GrafPtr) dc->m_macPort ) ;
m_clipRgn = NewRgn() ;
GetClip( m_clipRgn ) ;
m_dc = dc ; m_dc = dc ;
dc->MacSetupPort( NULL ) ; dc->MacSetupPort( NULL ) ;
} }
~wxMacFastPortSetter() ~wxMacFastPortSetter()
{ {
SetPort( (GrafPtr) m_dc->m_macPort ) ;
SetClip( m_clipRgn ) ;
SetPort( m_oldPort ) ; SetPort( m_oldPort ) ;
m_dc->MacCleanupPort( NULL ) ; m_dc->MacCleanupPort( NULL ) ;
DisposeRgn( m_clipRgn ) ;
} }
private : private :
RgnHandle m_clipRgn ;
GrafPtr m_oldPort ; GrafPtr m_oldPort ;
const wxDC* m_dc ; const wxDC* m_dc ;
} ; } ;

View File

@@ -71,15 +71,21 @@ public :
wxASSERT( dc->Ok() ) ; wxASSERT( dc->Ok() ) ;
GetPort( &m_oldPort ) ; GetPort( &m_oldPort ) ;
SetPort( (GrafPtr) dc->m_macPort ) ; SetPort( (GrafPtr) dc->m_macPort ) ;
m_clipRgn = NewRgn() ;
GetClip( m_clipRgn ) ;
m_dc = dc ; m_dc = dc ;
dc->MacSetupPort( NULL ) ; dc->MacSetupPort( NULL ) ;
} }
~wxMacFastPortSetter() ~wxMacFastPortSetter()
{ {
SetPort( (GrafPtr) m_dc->m_macPort ) ;
SetClip( m_clipRgn ) ;
SetPort( m_oldPort ) ; SetPort( m_oldPort ) ;
m_dc->MacCleanupPort( NULL ) ; m_dc->MacCleanupPort( NULL ) ;
DisposeRgn( m_clipRgn ) ;
} }
private : private :
RgnHandle m_clipRgn ;
GrafPtr m_oldPort ; GrafPtr m_oldPort ;
const wxDC* m_dc ; const wxDC* m_dc ;
} ; } ;