window moving

This commit is contained in:
Eduardo Bart
2011-04-16 16:46:31 -03:00
parent 9b02312bf8
commit dc39c965cc
13 changed files with 102 additions and 33 deletions

View File

@@ -66,7 +66,7 @@ void UILayout::setRect(const Rect& rect)
m_rect = rect;
// rect updated, recalculate itself and anchored elements positions
recalculateLayout();
recalculateAnchoredLayout();
}
bool UILayout::addAnchor(EAnchorType type, const AnchorLine& anchorLine)
@@ -141,14 +141,19 @@ void UILayout::recalculateLayout()
}
}
recalculateAnchoredLayout();
// fire layout update event
onLayoutRectChange(m_rect);
}
void UILayout::recalculateAnchoredLayout()
{
// recalculate anchored elements positions
for(auto it = m_anchoredElements.begin(); it != m_anchoredElements.end(); ++it) {
UILayoutPtr element = (*it).lock();
if(element)
element->recalculateLayout();
}
// fire layotu update event
onLayoutRectChange(m_rect);
}