|
|
@@ -1007,19 +1007,16 @@ void UI::GetElementAt(UIElement*& result, UIElement* current, const IntVector2&
|
|
|
i += (toSkip - 1);
|
|
|
}
|
|
|
}
|
|
|
+ // Note: we cannot check for the up / left limits of positioning, since the element may be off the visible
|
|
|
+ // screen but some of its layouted children will yet be visible. In down & right directions we can terminate
|
|
|
+ // the loop, since all further children will be further down or right.
|
|
|
else if (parentLayoutMode == LM_HORIZONTAL)
|
|
|
{
|
|
|
- if (element->GetScreenPosition().x_ < rootElement_->GetPosition().x_)
|
|
|
- break;
|
|
|
-
|
|
|
if (element->GetScreenPosition().x_ >= rootElement_->GetPosition().x_ + rootElement_->GetSize().x_)
|
|
|
break;
|
|
|
}
|
|
|
else if (parentLayoutMode == LM_VERTICAL)
|
|
|
{
|
|
|
- if (element->GetScreenPosition().y_ < rootElement_->GetPosition().y_)
|
|
|
- break;
|
|
|
-
|
|
|
if (element->GetScreenPosition().y_ >= rootElement_->GetPosition().y_ + rootElement_->GetSize().y_)
|
|
|
break;
|
|
|
}
|