diff --git a/CHANGELOG.md b/CHANGELOG.md index 170246c..e8c7a98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ Fixes - Fixed auto-navigating panels not scrolling to the center of elements properly - Fixed UiControls allowing for non-selectable or non-mouseable elements to be marked as selected or moused - Fixed buttons and checkboxes changing their CanBeSelected and CanBePressed values when being disabled +- Fixed children of Panel scroll bars also being scrolled Removals - Marked StyleProp equality members as obsolete diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index f452fc1..6d86fdd 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -119,7 +119,8 @@ namespace MLEM.Ui.Elements { if (!this.scrollOverflow) return; var offset = new Vector2(0, -this.ScrollBar.CurrentValue); - foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) { + // 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, Epsilon)) { child.ScrollOffset = offset; this.relevantChildrenDirty = true;