diff --git a/CHANGELOG.md b/CHANGELOG.md index 7678028..f768f25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Improvements Fixes - Fixed parents of elements that prevent spill not being notified properly - Fixed paragraphs sometimes not updating their position properly when hidden because they're empty +- Fixed panels sometimes not drawing children that came into view when their positions changed unexpectedly ### MLEM.Data Improvements diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 2d015f3..4be979a 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -118,14 +118,10 @@ namespace MLEM.Ui.Elements { private void ScrollChildren() { if (!this.scrollOverflow) return; - var offset = new Vector2(0, -this.ScrollBar.CurrentValue); // we ignore false grandchildren so that the children of the scroll bar stay in place - foreach (var child in this.GetChildren(c => c != this.ScrollBar, true, true)) { - if (!child.ScrollOffset.Equals(offset, Element.Epsilon)) { - child.ScrollOffset = offset; - this.relevantChildrenDirty = true; - } - } + foreach (var child in this.GetChildren(c => c != this.ScrollBar, true, true)) + child.ScrollOffset.Y = -this.ScrollBar.CurrentValue; + this.relevantChildrenDirty = true; } ///