diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 9c8d8dd..aeb703c 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -115,10 +115,13 @@ namespace MLEM.Ui.Elements { private void ScrollChildren() { if (!this.scrollOverflow) return; - var offset = -this.ScrollBar.CurrentValue; - foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) - child.ScrollOffset = new Vector2(0, offset); - this.relevantChildrenDirty = true; + var offset = new Vector2(0, -this.ScrollBar.CurrentValue); + foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) { + if (child.ScrollOffset != offset) { + child.ScrollOffset = offset; + this.relevantChildrenDirty = true; + } + } } ///