From 06f109575d10bc29e6fda32daacbfee550c13b1a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 21 Mar 2025 18:18:07 +0700 Subject: [PATCH] Fix children not getting re-sorted upon visibility changes --- .../dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt index e2be32ce9..247d22b28 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt @@ -281,11 +281,13 @@ open class EditablePanel( if (visibleChildrenParent?.contains(this) == false) { visibleChildrenParent.add(this) + parent?.invalidateChildrenSorting() parent?.layoutInvalidated = true } } else { if (visibleChildrenParent?.contains(this) == true) { visibleChildrenParent.remove(this) + parent?.invalidateChildrenSorting() parent?.layoutInvalidated = true } } @@ -1451,6 +1453,7 @@ open class EditablePanel( if (old != new) { child.visibilityChanges(new, old) + child.invalidateChildrenSorting() } child.updateVisible()