fix window rectangle computation in Centre(wxCENTER_ON_SCREEN)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-05-17 12:56:18 +00:00
parent bfeb1a5c06
commit b0e8363354

View File

@@ -260,8 +260,11 @@ void wxTopLevelWindowBase::DoCentre(int dir)
if((rectParent == rectDisplay) && IsMaximized())
return;
if ( !(dir & wxBOTH) )
dir |= wxBOTH; // if neither is specified, center in both directions
// the new window rect candidate
wxRect rect = GetRect().CentreIn(rectParent, dir);
wxRect rect = GetRect().CentreIn(rectParent, dir & ~wxCENTRE_ON_SCREEN);
// we don't want to place the window off screen if Centre() is called as
// this is (almost?) never wanted and it would be very difficult to prevent