CtrlCore: X11Top.cpp centering fix (thanks Klugier)

git-svn-id: svn://ultimatepp.org/upp/trunk@6299 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-09-01 16:57:43 +00:00
parent c41df4e80f
commit f4afcd88be

View file

@ -238,8 +238,9 @@ void TopWindow::CenterRect(Ctrl *owner)
else
r = wr;
Point p = r.CenterPos(sz);
r = RectC(p.x, p.y, sz.cx, sz.cy);
if (p.x <= wr.Width() && p.y <= wr.Height()) {
r = RectC(p.x, p.y, sz.cx, sz.cy);
wr.left += fm.left;
wr.right -= fm.right;
wr.top += fm.top;
@ -252,8 +253,8 @@ void TopWindow::CenterRect(Ctrl *owner)
r.bottom = wr.bottom;
minsize.cx = min(minsize.cx, r.GetWidth());
minsize.cy = min(minsize.cy, r.GetHeight());
SetRect(r);
}
SetRect(r);
}
}