Browse Source

Fixes #877

Controls only need to be ordered by Z-Order when within an absolute layout.
For all other layouts created so far, controls should never overlap, and their order should be kept as it was created.
Adam Blake 13 years ago
parent
commit
930dff649e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      gameplay/src/Container.cpp

+ 4 - 1
gameplay/src/Container.cpp

@@ -434,7 +434,10 @@ void Container::update(const Control* container, const Vector2& offset)
     }
 
     // Sort controls by Z-Order.
-    std::sort(_controls.begin(), _controls.end(), &sortControlsByZOrder);
+    if (_layout->getType() == Layout::LAYOUT_ABSOLUTE)
+    {
+        std::sort(_controls.begin(), _controls.end(), &sortControlsByZOrder);
+    }
 
     GP_ASSERT(_layout);
     if (_scroll != SCROLL_NONE)