wxMacFastPortSetter( const wxDC *dc )
{
wxASSERT( dc->Ok() ) ;
- GetPort( &m_oldPort ) ;
- SetPort( (GrafPtr) dc->m_macPort ) ;
+ m_swapped = QDSwapPort( (GrafPtr) dc->m_macPort , &m_oldPort ) ;
m_clipRgn = NewRgn() ;
GetClip( m_clipRgn ) ;
m_dc = dc ;
}
~wxMacFastPortSetter()
{
- SetPort( (GrafPtr) m_dc->m_macPort ) ;
+ // SetPort( (GrafPtr) m_dc->m_macPort ) ;
SetClip( m_clipRgn ) ;
- SetPort( m_oldPort ) ;
+ if ( m_swapped )
+ SetPort( m_oldPort ) ;
m_dc->MacCleanupPort( NULL ) ;
DisposeRgn( m_clipRgn ) ;
}
private :
+ bool m_swapped ;
RgnHandle m_clipRgn ;
GrafPtr m_oldPort ;
const wxDC* m_dc ;
{
wxMacFastPortSetter helper(this) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
- m_clipping = FALSE;
+ ResetClipping();
}
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
// this is a bit artificial, but we need to force wxDC to think
// the pen has changed
- wxPen* pen = & GetPen();
- wxPen tempPen;
- m_pen = tempPen;
- SetPen(* pen);
+ wxPen pen(GetPen());
+ m_pen = wxNullPen;
+ SetPen(pen);
}
}