added wxRect::CentreIn()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -428,6 +428,20 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// centre this rectangle in the given (usually, but not necessarily,
|
||||
// larger) one
|
||||
wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const
|
||||
{
|
||||
return wxRect(dir & wxHORIZONTAL ? r.x + (r.width - width)/2 : x,
|
||||
dir & wxVERTICAL ? r.y + (r.height - height)/2 : y,
|
||||
width, height);
|
||||
}
|
||||
|
||||
wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const
|
||||
{
|
||||
return CentreIn(r, dir);
|
||||
}
|
||||
|
||||
public:
|
||||
int x, y, width, height;
|
||||
};
|
||||
|
Reference in New Issue
Block a user