mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlCore: Fixed issue with X11Top.cpp (thanks Klugier)
git-svn-id: svn://ultimatepp.org/upp/trunk@6264 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7f59ce607e
commit
a8d4ce3881
1 changed files with 13 additions and 11 deletions
|
|
@ -239,18 +239,20 @@ void TopWindow::CenterRect(Ctrl *owner)
|
|||
r = wr;
|
||||
Point p = r.CenterPos(sz);
|
||||
r = RectC(p.x, p.y, sz.cx, sz.cy);
|
||||
wr.left += fm.left;
|
||||
wr.right -= fm.right;
|
||||
wr.top += fm.top;
|
||||
wr.bottom -= fm.bottom;
|
||||
if(r.top < wr.top) {
|
||||
r.bottom += wr.top - r.top;
|
||||
r.top = wr.top;
|
||||
if (p.x <= wr.Width() && p.y <= wr.Height()) {
|
||||
wr.left += fm.left;
|
||||
wr.right -= fm.right;
|
||||
wr.top += fm.top;
|
||||
wr.bottom -= fm.bottom;
|
||||
if(r.top < wr.top) {
|
||||
r.bottom += wr.top - r.top;
|
||||
r.top = wr.top;
|
||||
}
|
||||
if(r.bottom > wr.bottom)
|
||||
r.bottom = wr.bottom;
|
||||
minsize.cx = min(minsize.cx, r.GetWidth());
|
||||
minsize.cy = min(minsize.cy, r.GetHeight());
|
||||
}
|
||||
if(r.bottom > wr.bottom)
|
||||
r.bottom = wr.bottom;
|
||||
minsize.cx = min(minsize.cx, r.GetWidth());
|
||||
minsize.cy = min(minsize.cy, r.GetHeight());
|
||||
SetRect(r);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue