1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-26 10:19:22 +01: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);
foreach (var child in this.Children)