diff --git a/include/wx/dc.h b/include/wx/dc.h index 2637b5a828..ac0f97d6ea 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -445,14 +445,17 @@ public: virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const { + int dcWidth, dcHeight; + DoGetSize(&dcWidth, &dcHeight); + if ( x ) - *x = m_clipX1; + *x = m_clipping ? m_clipX1 : 0; if ( y ) - *y = m_clipY1; + *y = m_clipping ? m_clipY1 : 0; if ( w ) - *w = m_clipX2 - m_clipX1; + *w = m_clipping ? m_clipX2 - m_clipX1 : dcWidth; if ( h ) - *h = m_clipY2 - m_clipY1; + *h = m_clipping ? m_clipY2 - m_clipY1 : dcHeight; } virtual void DestroyClippingRegion() { ResetClipping(); } diff --git a/interface/wx/dc.h b/interface/wx/dc.h index 82aa64a36e..748e0a7812 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -755,6 +755,8 @@ public: /** Gets the rectangle surrounding the current clipping region. + If no clipping region is set this function returns the extent + of the device context. */ void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *width, wxCoord *height) const;