mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
walk changes, nothing special
This commit is contained in:
@@ -96,14 +96,7 @@ void UIWindow::onGeometryUpdate(const Rect& oldRect, const Rect& newRect)
|
||||
UIWidgetPtr parent = getParent();
|
||||
if(parent) {
|
||||
Rect parentRect = parent->getRect();
|
||||
if(boundRect.left() < parentRect.left())
|
||||
boundRect.moveLeft(parentRect.left());
|
||||
if(boundRect.top() < parentRect.top())
|
||||
boundRect.moveTop(parentRect.top());
|
||||
if(boundRect.bottom() > parentRect.bottom())
|
||||
boundRect.moveBottom(parentRect.bottom());
|
||||
if(boundRect.right() > parentRect.right())
|
||||
boundRect.moveRight(parentRect.right());
|
||||
boundRect.bound(parentRect);
|
||||
}
|
||||
|
||||
if(boundRect != newRect)
|
||||
|
@@ -251,6 +251,20 @@ public:
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void bound(const TRect<T> &r) {
|
||||
if(isNull() || r.isNull())
|
||||
return;
|
||||
|
||||
if(left() < r.left())
|
||||
moveLeft(r.left());
|
||||
if(top() < r.top())
|
||||
moveTop(r.top());
|
||||
if(bottom() > r.bottom())
|
||||
moveBottom(r.bottom());
|
||||
if(right() > r.right())
|
||||
moveRight(r.right());
|
||||
}
|
||||
|
||||
TRect<T>& operator=(const TRect<T>& other) { x1 = other.x1; y1 = other.y1; x2 = other.x2; y2 = other.y2; return *this; }
|
||||
bool operator==(const TRect<T>& other) const { return (x1 == other.x1 && y1 == other.y1 && x2 == other.x2 && y2 == other.y2); }
|
||||
bool operator!=(const TRect<T>& other) const { return (x1 != other.x1 || y1 != other.y1 || x2 != other.x2 || y2 != other.y2); }
|
||||
|
Reference in New Issue
Block a user