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

only update an element and its children if the area actually changed

This commit is contained in:
Ellpeck 2019-09-04 16:48:44 +02:00
parent 1ee7fafc23
commit 9deb6bbce3

View file

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