From 4d34a2fac107c18db59e7ddbd17dece53c6e8c34 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 4 Aug 2022 20:14:29 +0200 Subject: [PATCH] Fixed parents of elements that prevent spill not being notified properly --- CHANGELOG.md | 3 +++ MLEM.Ui/Elements/Element.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b596bb5..e603684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ Improvements - Allow elements to auto-adjust their size even when their children are aligned oddly - Close other dropdowns when opening a dropdown +Fixes +- Fixed parents of elements that prevent spill not being notified properly + ### MLEM.Data Improvements - Allow data texture atlas pivots and offsets to be negative diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index ebd4a22..b242c56 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -1125,7 +1125,7 @@ namespace MLEM.Ui.Elements { /// Whether the is a grandchild of this element, rather than a direct child. protected virtual void OnChildAreaDirty(Element child, bool grandchild) { if (!grandchild) { - if (child.Anchor.IsAuto() || this.SetWidthBasedOnChildren || this.SetHeightBasedOnChildren) + if (child.Anchor.IsAuto() || child.PreventParentSpill || this.SetWidthBasedOnChildren || this.SetHeightBasedOnChildren) this.SetAreaDirty(); } this.Parent?.OnChildAreaDirty(child, true);