1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-10 03:28:43 +02:00

Fixed children of Panel scroll bars also being scrolled

This commit is contained in:
Ell 2022-03-17 20:04:58 +01:00
parent fa34258bbe
commit bb22bbdf75
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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;