- region.GetBox( xx, yy, ww, hh );
- wxDC::DoSetClippingRegion( xx, yy, ww, hh );
+
+ xx = XLOG2DEV(x);
+ yy = YLOG2DEV(y);
+ ww = XLOG2DEVREL(w);
+ hh = YLOG2DEVREL(h);
+
+ // if we have a scaling that we cannot map onto native regions
+ // we must use the box
+
+ if ( ww != w || hh != h )
+ {
+ wxDC::DoSetClippingRegion( x, y, w, h );
+ }
+ else
+ {
+ CopyRgn( region.GetWXHRGN() , m_macCurrentClipRgn ) ;
+ if ( xx != x || yy != y )
+ {
+ OffsetRgn( m_macCurrentClipRgn , xx - x , yy - y ) ;
+ }
+ SectRgn( m_macCurrentClipRgn , m_macBoundaryClipRgn , m_macCurrentClipRgn ) ;
+ if( m_clipping )
+ {
+ m_clipX1 = wxMax( m_clipX1 , xx );
+ m_clipY1 = wxMax( m_clipY1 , yy );
+ m_clipX2 = wxMin( m_clipX2, (xx + ww));
+ m_clipY2 = wxMin( m_clipY2, (yy + hh));
+ }
+ else
+ {
+ m_clipping = TRUE;
+ m_clipX1 = xx;
+ m_clipY1 = yy;
+ m_clipX2 = xx + ww;
+ m_clipY2 = yy + hh;
+ }
+ }
+