mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 14:38:34 +01:00
skip unnecessary relevant children updates for panels
This commit is contained in:
parent
115b05beaa
commit
cf48fc372e
1 changed files with 7 additions and 4 deletions
|
@ -115,11 +115,14 @@ namespace MLEM.Ui.Elements {
|
||||||
private void ScrollChildren() {
|
private void ScrollChildren() {
|
||||||
if (!this.scrollOverflow)
|
if (!this.scrollOverflow)
|
||||||
return;
|
return;
|
||||||
var offset = -this.ScrollBar.CurrentValue;
|
var offset = new Vector2(0, -this.ScrollBar.CurrentValue);
|
||||||
foreach (var child in this.GetChildren(c => c != this.ScrollBar, true))
|
foreach (var child in this.GetChildren(c => c != this.ScrollBar, true)) {
|
||||||
child.ScrollOffset = new Vector2(0, offset);
|
if (child.ScrollOffset != offset) {
|
||||||
|
child.ScrollOffset = offset;
|
||||||
this.relevantChildrenDirty = true;
|
this.relevantChildrenDirty = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void ForceUpdateSortedChildren() {
|
public override void ForceUpdateSortedChildren() {
|
||||||
|
|
Loading…
Reference in a new issue