mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 22:18:34 +01:00
only update an element and its children if the area actually changed
This commit is contained in:
parent
1ee7fafc23
commit
9deb6bbce3
1 changed files with 5 additions and 1 deletions
|
@ -307,7 +307,11 @@ namespace MLEM.Ui.Elements {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.area = new Rectangle(pos, actualSize);
|
var newArea = new Rectangle(pos, actualSize);
|
||||||
|
if (newArea == this.area)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.area = newArea;
|
||||||
this.OnAreaUpdated?.Invoke(this);
|
this.OnAreaUpdated?.Invoke(this);
|
||||||
|
|
||||||
foreach (var child in this.Children)
|
foreach (var child in this.Children)
|
||||||
|
|
Loading…
Reference in a new issue