use ResetClipping() instead of simply setting m_clipping to false; added call to it to wxDCBase::DestroyClippingRegion() so that some ports don't have to define their own version of it at all
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -133,6 +133,7 @@ public:
|
||||
#endif // wxUSE_PALETTE
|
||||
{
|
||||
ResetBoundingBox();
|
||||
ResetClipping();
|
||||
}
|
||||
|
||||
~wxDCBase() { }
|
||||
@@ -390,21 +391,13 @@ public:
|
||||
void SetClippingRegion(const wxRegion& region)
|
||||
{ DoSetClippingRegionAsRegion(region); }
|
||||
|
||||
virtual void DestroyClippingRegion() = 0;
|
||||
virtual void DestroyClippingRegion() { ResetClipping(); }
|
||||
|
||||
void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
|
||||
{ DoGetClippingBox(x, y, w, h); }
|
||||
void GetClippingBox(wxRect& rect) const
|
||||
{
|
||||
#if 1
|
||||
DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height);
|
||||
#else
|
||||
// Necessary to use intermediate variables for 16-bit compilation
|
||||
// REMOVE ME if the above is OK for all current platforms
|
||||
wxCoord x, y, w, h;
|
||||
DoGetClippingBox(&x, &y, &w, &h);
|
||||
rect.x = x; rect.y = y; rect.width = w; rect.height = h;
|
||||
#endif
|
||||
}
|
||||
|
||||
// text extent
|
||||
@@ -699,17 +692,14 @@ protected:
|
||||
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
|
||||
wxCoord *w, wxCoord *h) const
|
||||
{
|
||||
if ( m_clipping )
|
||||
{
|
||||
if ( x ) *x = m_clipX1;
|
||||
if ( y ) *y = m_clipY1;
|
||||
if ( w ) *w = m_clipX2 - m_clipX1;
|
||||
if ( h ) *h = m_clipY2 - m_clipY1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x = *y = *w = *h = 0;
|
||||
}
|
||||
if ( x )
|
||||
*x = m_clipX1;
|
||||
if ( y )
|
||||
*y = m_clipY1;
|
||||
if ( w )
|
||||
*w = m_clipX2 - m_clipX1;
|
||||
if ( h )
|
||||
*h = m_clipY2 - m_clipY1;
|
||||
}
|
||||
|
||||
virtual void DoGetLogicalOrigin(wxCoord *x, wxCoord *y) const
|
||||
@@ -737,6 +727,14 @@ protected:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// unset clipping variables (after clipping region was destroyed)
|
||||
void ResetClipping()
|
||||
{
|
||||
m_clipping = false;
|
||||
|
||||
m_clipX1 = m_clipX2 = m_clipY1 = m_clipY2 = 0;
|
||||
}
|
||||
|
||||
// flags
|
||||
bool m_colour:1;
|
||||
bool m_ok:1;
|
||||
|
@@ -46,9 +46,6 @@ public:
|
||||
|
||||
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
|
||||
|
||||
// the first two must be overridden and called
|
||||
virtual void DestroyClippingRegion();
|
||||
|
||||
// Resolution in pixels per logical inch
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
|
@@ -46,9 +46,6 @@ public:
|
||||
|
||||
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
|
||||
|
||||
// the first two must be overridden and called
|
||||
virtual void DestroyClippingRegion();
|
||||
|
||||
// Resolution in pixels per logical inch
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
|
@@ -52,8 +52,6 @@ public:
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void DestroyClippingRegion();
|
||||
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
virtual void SetMapMode(int mode);
|
||||
|
@@ -50,8 +50,6 @@ public:
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void DestroyClippingRegion();
|
||||
|
||||
virtual wxSize GetPPI() const;
|
||||
|
||||
virtual void SetMapMode(int mode);
|
||||
|
@@ -65,11 +65,6 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
m_clipY2 = y + height;
|
||||
}
|
||||
|
||||
void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
m_clipping = FALSE;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// get DC capabilities
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -65,11 +65,6 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
m_clipY2 = y + height;
|
||||
}
|
||||
|
||||
void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
m_clipping = FALSE;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// get DC capabilities
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -512,7 +512,7 @@ void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
wxMacFastPortSetter helper(this) ;
|
||||
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
||||
m_clipping = FALSE;
|
||||
ResetClipping();
|
||||
}
|
||||
|
||||
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||
|
@@ -533,7 +533,7 @@ void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
wxMacFastPortSetter helper(this) ;
|
||||
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
||||
m_clipping = FALSE;
|
||||
ResetClipping();
|
||||
}
|
||||
|
||||
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||
|
@@ -288,7 +288,7 @@ void wxDC::DestroyClippingRegion()
|
||||
else
|
||||
{
|
||||
m_MGLDC->setClipRect(MGLRect(0, 0, m_MGLDC->sizex()+1, m_MGLDC->sizey()+1));
|
||||
m_clipping = FALSE;
|
||||
ResetClipping();
|
||||
m_currentClippingRegion.Clear();
|
||||
}
|
||||
}
|
||||
|
@@ -90,11 +90,6 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
m_clipY2 = y + height;
|
||||
}
|
||||
|
||||
void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
m_clipping = FALSE;
|
||||
}
|
||||
|
||||
void wxDC::DoGetSize( int* width, int* height ) const
|
||||
{
|
||||
if ( width )
|
||||
|
@@ -503,7 +503,7 @@ void wxDC::DestroyClippingRegion(void)
|
||||
|
||||
::GpiSetClipRegion(m_hPS, hRgn, &hRgnOld);
|
||||
}
|
||||
m_clipping = false;
|
||||
ResetClipping();
|
||||
} // end of wxDC::DestroyClippingRegion
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user