Restore previous clipping box in wxDCClipper
Remember the clipping box of the previously active clipping region in wxDCClipper ctor and restore it in its dtor. See #13834.
This commit is contained in:
@@ -1436,16 +1436,30 @@ class WXDLLIMPEXP_CORE wxDCClipper
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc)
|
wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc)
|
||||||
{ dc.SetClippingRegion(r.GetBox()); }
|
{
|
||||||
|
dc.GetClippingBox(m_oldClipRect);
|
||||||
|
dc.SetClippingRegion(r.GetBox());
|
||||||
|
}
|
||||||
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
|
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
|
||||||
{ dc.SetClippingRegion(r.x, r.y, r.width, r.height); }
|
{
|
||||||
|
dc.GetClippingBox(m_oldClipRect);
|
||||||
|
dc.SetClippingRegion(r.x, r.y, r.width, r.height);
|
||||||
|
}
|
||||||
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
|
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
|
||||||
{ dc.SetClippingRegion(x, y, w, h); }
|
{
|
||||||
|
dc.GetClippingBox(m_oldClipRect);
|
||||||
|
dc.SetClippingRegion(x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
~wxDCClipper() { m_dc.DestroyClippingRegion(); }
|
~wxDCClipper()
|
||||||
|
{
|
||||||
|
m_dc.DestroyClippingRegion();
|
||||||
|
m_dc.SetClippingRegion(m_oldClipRect);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxDC& m_dc;
|
wxDC& m_dc;
|
||||||
|
wxRect m_oldClipRect;
|
||||||
|
|
||||||
wxDECLARE_NO_COPY_CLASS(wxDCClipper);
|
wxDECLARE_NO_COPY_CLASS(wxDCClipper);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user