Fix destroying clipping region for wxGCDC with applied affine transformation

We need to take into account all aplied transformations (including affine
transformations set with SetTransformMatrix()) while resetting clipping
box to its initial size.
This commit is contained in:
Artur Wieczorek
2021-07-20 22:52:18 +02:00
parent 42ee966b63
commit 9e5c3a1152

View File

@@ -420,7 +420,9 @@ void wxGCDCImpl::DestroyClippingRegion()
#ifdef __WXOSX__
origin = OSXGetOrigin();
#endif
m_graphicContext->Clip( DeviceToLogicalX(origin.x) , DeviceToLogicalY(origin.y) , DeviceToLogicalXRel(width), DeviceToLogicalYRel(height) );
wxPoint clipOrig = DeviceToLogical(origin.x, origin.y);
wxSize clipDim = DeviceToLogicalRel(width, height);
m_graphicContext->Clip(clipOrig.x, clipOrig.y, clipDim.x, clipDim.y);
m_graphicContext->SetPen( m_pen );
m_graphicContext->SetBrush( m_brush );