bug report module

* change modules authors and website
* avoid anchors recursivity crash
* update README
This commit is contained in:
Eduardo Bart
2012-05-01 10:06:38 -03:00
parent 69614da8cb
commit 788a831f24
39 changed files with 204 additions and 68 deletions

View File

@@ -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);
}
}

View File

@@ -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;
};