Ver código fonte

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 anos atrás
pai
commit
930dff649e
1 arquivos alterados com 4 adições e 1 exclusões
  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.
     // 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);
     GP_ASSERT(_layout);
     if (_scroll != SCROLL_NONE)
     if (_scroll != SCROLL_NONE)