Refactor wxDCClipper ctors to use a common Init() method
No changes, this is just a pure refactoring to facilitate the upcoming change which won't have to be done in all these ctors any more.
This commit is contained in:
@@ -1437,18 +1437,15 @@ 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.GetClippingBox(m_oldClipRect);
|
Init(r.GetBox());
|
||||||
dc.SetClippingRegion(r.GetBox());
|
|
||||||
}
|
}
|
||||||
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
|
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
|
||||||
{
|
{
|
||||||
dc.GetClippingBox(m_oldClipRect);
|
Init(r);
|
||||||
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.GetClippingBox(m_oldClipRect);
|
Init(wxRect(x, y, w, h));
|
||||||
dc.SetClippingRegion(x, y, w, h);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~wxDCClipper()
|
~wxDCClipper()
|
||||||
@@ -1459,6 +1456,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Common part of all ctors.
|
||||||
|
void Init(const wxRect& r)
|
||||||
|
{
|
||||||
|
m_dc.GetClippingBox(m_oldClipRect);
|
||||||
|
m_dc.SetClippingRegion(r);
|
||||||
|
}
|
||||||
|
|
||||||
wxDC& m_dc;
|
wxDC& m_dc;
|
||||||
wxRect m_oldClipRect;
|
wxRect m_oldClipRect;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user