ui more error proning

This commit is contained in:
Eduardo Bart
2011-04-10 18:12:42 -03:00
parent 992e0a8a6b
commit dcbe4855bd
7 changed files with 62 additions and 132 deletions

View File

@@ -241,13 +241,14 @@ void UILoader::loadElementAnchor(const UIElementPtr& element, EAnchorType type,
if(relativeElementId == "parent" && element->getParent()) {
relativeElement = element->getParent()->asUILayout();
} else {
UIElementPtr tmp = UIContainer::getRootContainer()->recursiveGetChildById(relativeElementId);
UIElementPtr tmp = element->backwardsGetElementById(relativeElementId);
if(tmp)
relativeElement = tmp->asUILayout();
}
if(relativeElement) {
element->addAnchor(type, AnchorLine(relativeElement, relativeAnchorType));
if(!element->addAnchor(type, AnchorLine(relativeElement, relativeAnchorType)))
throw YAML::Exception(node.GetMark(), "error while processing anchors");
} else {
throw YAML::Exception(node.GetMark(), "anchoring failed, does the relative element really exists?");
}