diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index ce29469..1d702eb 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -355,11 +355,8 @@ namespace MLEM.Ui.Elements { } private void ScrollChildren() { - if (!this.scrollOverflow) { - if (this.scrolledChildren.Count > 0) - this.scrolledChildren.Clear(); + if (!this.scrollOverflow) return; - } // we ignore false grandchildren so that the children of the scroll bar stay in place var currentChildren = new HashSet(this.GetChildren(c => c != this.ScrollBar, true, true));