1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-06-07 15:23:37 +02:00

modify unnecessarily thorough SetAreaDirty when adding/removing children

This commit is contained in:
Ellpeck 2020-05-17 00:33:16 +02:00
parent 037ed43410
commit 85e63ac998

View file

@ -183,12 +183,15 @@ namespace MLEM.Ui.Elements {
this.Root.OnElementAdded(e);
});
this.SetSortedChildrenDirty();
this.SetAreaDirty();
element.SetAreaDirty();
return element;
}
public void RemoveChild(Element element) {
this.Children.Remove(element);
// set area dirty here so that a dirty call is made
// upwards to us if the element is auto-positioned
element.SetAreaDirty();
element.Parent = null;
element.AndChildren(e => {
e.Root = null;
@ -197,7 +200,6 @@ namespace MLEM.Ui.Elements {
this.Root.OnElementRemoved(e);
});
this.SetSortedChildrenDirty();
this.SetAreaDirty();
}
public void RemoveChildren(Func<Element, bool> condition = null) {