mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
bug report module
* change modules authors and website * avoid anchors recursivity crash * update README
This commit is contained in:
@@ -86,12 +86,20 @@ void UIAnchorLayout::removeWidget(const UIWidgetPtr& widget)
|
||||
removeAnchors(widget);
|
||||
}
|
||||
|
||||
bool UIAnchorLayout::updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anchorGroup)
|
||||
bool UIAnchorLayout::updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anchorGroup, UIWidgetPtr first)
|
||||
{
|
||||
UIWidgetPtr parentWidget = getParentWidget();
|
||||
if(!parentWidget)
|
||||
return false;
|
||||
|
||||
if(first == widget) {
|
||||
logError("child '", widget->getId(), "' of parent widget '", parentWidget->getId(), "' is recursively anchored to itself, please fix this");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!first)
|
||||
first = widget;
|
||||
|
||||
Rect newRect = widget->getRect();
|
||||
bool verticalMoved = false;
|
||||
bool horizontalMoved = false;
|
||||
@@ -125,7 +133,7 @@ bool UIAnchorLayout::updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anch
|
||||
if(it != m_anchorsGroups.end()) {
|
||||
UIAnchorGroup& hookedAnchorGroup = it->second;
|
||||
if(!hookedAnchorGroup.isUpdated())
|
||||
updateWidget(hookedWidget, hookedAnchorGroup);
|
||||
updateWidget(hookedWidget, hookedAnchorGroup, first);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -79,7 +79,7 @@ protected:
|
||||
bool internalUpdate();
|
||||
|
||||
private:
|
||||
bool updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anchorGroup);
|
||||
bool updateWidget(const UIWidgetPtr& widget, UIAnchorGroup& anchorGroup, UIWidgetPtr first = nullptr);
|
||||
std::map<UIWidgetPtr, UIAnchorGroup> m_anchorsGroups;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user