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:
parent
caa2fde425
commit
fe0f9fefe4
@ -1437,18 +1437,15 @@ class WXDLLIMPEXP_CORE wxDCClipper
|
||||
public:
|
||||
wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc)
|
||||
{
|
||||
dc.GetClippingBox(m_oldClipRect);
|
||||
dc.SetClippingRegion(r.GetBox());
|
||||
Init(r.GetBox());
|
||||
}
|
||||
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
|
||||
{
|
||||
dc.GetClippingBox(m_oldClipRect);
|
||||
dc.SetClippingRegion(r.x, r.y, r.width, r.height);
|
||||
Init(r);
|
||||
}
|
||||
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
|
||||
{
|
||||
dc.GetClippingBox(m_oldClipRect);
|
||||
dc.SetClippingRegion(x, y, w, h);
|
||||
Init(wxRect(x, y, w, h));
|
||||
}
|
||||
|
||||
~wxDCClipper()
|
||||
@ -1459,6 +1456,13 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
void Init(const wxRect& r)
|
||||
{
|
||||
m_dc.GetClippingBox(m_oldClipRect);
|
||||
m_dc.SetClippingRegion(r);
|
||||
}
|
||||
|
||||
wxDC& m_dc;
|
||||
wxRect m_oldClipRect;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user