1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

Fixed panels sometimes not drawing children that came into view when their positions changed unexpectedly

This commit is contained in:
Ell 2022-08-04 21:03:16 +02:00
parent 8332f56237
commit f0432ab981
2 changed files with 4 additions and 7 deletions

View file

@ -26,6 +26,7 @@ Improvements
Fixes Fixes
- Fixed parents of elements that prevent spill not being notified properly - 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 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 ### MLEM.Data
Improvements Improvements

View file

@ -118,15 +118,11 @@ namespace MLEM.Ui.Elements {
private void ScrollChildren() { private void ScrollChildren() {
if (!this.scrollOverflow) if (!this.scrollOverflow)
return; return;
var offset = new Vector2(0, -this.ScrollBar.CurrentValue);
// we ignore false grandchildren so that the children of the scroll bar stay in place // 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)) { foreach (var child in this.GetChildren(c => c != this.ScrollBar, true, true))
if (!child.ScrollOffset.Equals(offset, Element.Epsilon)) { child.ScrollOffset.Y = -this.ScrollBar.CurrentValue;
child.ScrollOffset = offset;
this.relevantChildrenDirty = true; this.relevantChildrenDirty = true;
} }
}
}
/// <inheritdoc /> /// <inheritdoc />
public override void ForceUpdateSortedChildren() { public override void ForceUpdateSortedChildren() {