diff --git a/CHANGELOG.md b/CHANGELOG.md index cc6c365..bdafc7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ Fixes - Fixed auto-nav tooltip displaying on the selected element even when not in auto-nav mode - Fixed radio buttons not unchecking all other radio buttons with the same root element - Fixed elements not being deselected when removed through RemoveChild +- Fixed elements sometimes staying hidden when they shouldn't in scrolling panels Removals - Marked old Draw and DrawTransformed overloads as obsolete in favor of SpriteBatchContext ones diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index aa8f883..91141e5 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -901,13 +901,14 @@ namespace MLEM.Ui.Elements { } /// - /// Updates this element and all of its + /// Updates this element and all of its /// /// The game's time public virtual void Update(GameTime time) { this.System.InvokeOnElementUpdated(this, time); - foreach (var child in this.GetRelevantChildren()) { + // update all sorted children, not just relevant ones, because they might become relevant or irrelevant through updates + foreach (var child in this.SortedChildren) { if (child.System != null) child.Update(time); } diff --git a/MLEM.Ui/Elements/Paragraph.cs b/MLEM.Ui/Elements/Paragraph.cs index 1d29a06..9c34142 100644 --- a/MLEM.Ui/Elements/Paragraph.cs +++ b/MLEM.Ui/Elements/Paragraph.cs @@ -59,8 +59,13 @@ namespace MLEM.Ui.Elements { set { if (this.text != value) { this.text = value; - this.forceHide = string.IsNullOrWhiteSpace(this.text); this.SetTextDirty(); + + var force = string.IsNullOrWhiteSpace(this.text); + if (this.forceHide != force) { + this.forceHide = force; + this.SetAreaDirty(); + } } } }