From 43bf00dcea1925d2622cc919da852c792d69a29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 2 Jun 2026 02:09:15 -0300 Subject: [PATCH] Fix bad merge. :S --- src/eepp/ui/uihtmlwidget.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/eepp/ui/uihtmlwidget.cpp b/src/eepp/ui/uihtmlwidget.cpp index 37f1fccdd..598afcabd 100644 --- a/src/eepp/ui/uihtmlwidget.cpp +++ b/src/eepp/ui/uihtmlwidget.cpp @@ -237,6 +237,28 @@ void UIHTMLWidget::setNeedsOrderSort( bool val ) { mNeedsOrderSort = val; } +void UIHTMLWidget::updateZIndexSortFlag() { + bool needs = false; + for ( Node* child = getFirstChild(); child; child = child->getNextNode() ) { + if ( child->isType( UI_TYPE_HTML_WIDGET ) && + child->asType()->getZIndex() != 0 ) { + needs = true; + break; + } + } + mNeedsZIndexSort = needs; +} + +void UIHTMLWidget::onChildCountChange( Node* child, const bool& removed ) { + UILayout::onChildCountChange( child, removed ); + + if ( !removed ) + updateZIndexSortFlag(); + else if ( child->isType( UI_TYPE_HTML_WIDGET ) && + child->asType()->getZIndex() != 0 ) + updateZIndexSortFlag(); +} + void UIHTMLWidget::drawChildren() { bool flexSort = false; bool directionReverse = false;