Fixed retrieving clipping box parameters when there is no clipping region set.

When there is no clipping region currently set then current effective clipping region is identical with entire DC surface and therefore DC size should be returned as a region size.

Closes #17013
This commit is contained in:
Artur Wieczorek
2016-07-03 22:24:30 +02:00
parent 0b8975ac18
commit 8615921f42
2 changed files with 9 additions and 4 deletions

View File

@@ -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(); }