1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 22:48:34 +01: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.Root.OnElementAdded(e);
}); });
this.SetSortedChildrenDirty(); this.SetSortedChildrenDirty();
this.SetAreaDirty(); element.SetAreaDirty();
return element; return element;
} }
public void RemoveChild(Element element) { public void RemoveChild(Element element) {
this.Children.Remove(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.Parent = null;
element.AndChildren(e => { element.AndChildren(e => {
e.Root = null; e.Root = null;
@ -197,7 +200,6 @@ namespace MLEM.Ui.Elements {
this.Root.OnElementRemoved(e); this.Root.OnElementRemoved(e);
}); });
this.SetSortedChildrenDirty(); this.SetSortedChildrenDirty();
this.SetAreaDirty();
} }
public void RemoveChildren(Func<Element, bool> condition = null) { public void RemoveChildren(Func<Element, bool> condition = null) {