Browse Source

Only use item binary search when container is in vertical layout mode.

Lasse Öörni 12 years ago
parent
commit
a7bc939b7d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/Engine/UI/ListView.cpp

+ 1 - 1
Source/Engine/UI/ListView.cpp

@@ -803,7 +803,7 @@ unsigned ListView::FindItem(UIElement* item) const
     const Vector<SharedPtr<UIElement> >& children = contentElement_->GetChildren();
 
     // Binary search for list item based on screen coordinate Y
-    if (item->GetHeight())
+    if (contentElement_->GetLayoutMode() == LM_VERTICAL && item->GetHeight())
     {
         int itemY = item->GetScreenPosition().y_;
         int left = 0;