1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-06-01 04:43:37 +02:00

skip unnecessary relevant children updates for panels

This commit is contained in:
Ell 2021-11-01 22:58:37 +01:00
parent 115b05beaa
commit cf48fc372e

View file

@ -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;
}
}
}
/// <inheritdoc />