1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

Fixed elements not being deselected when removed through RemoveChild

This commit is contained in:
Ell 2022-04-15 14:16:38 +02:00
parent be26a2ebc2
commit 783da33107
2 changed files with 3 additions and 0 deletions

View file

@ -20,6 +20,7 @@ Additions
Fixes Fixes
- Fixed auto-nav tooltip displaying on the selected element even when not in auto-nav mode - Fixed auto-nav tooltip displaying on the selected element even when not in auto-nav mode
- Fixed radio buttons not unchecking all other radio buttons with the same root element - Fixed radio buttons not unchecking all other radio buttons with the same root element
- Fixed elements not being deselected when removed through RemoveChild
## 5.3.0 ## 5.3.0
### MLEM ### MLEM

View file

@ -485,6 +485,8 @@ namespace MLEM.Ui.Elements {
/// <param name="element">The child element to remove</param> /// <param name="element">The child element to remove</param>
public virtual void RemoveChild(Element element) { public virtual void RemoveChild(Element element) {
this.children.Remove(element); this.children.Remove(element);
if (this.Root?.SelectedElement == element)
this.Root.SelectElement(null);
// set area dirty here so that a dirty call is made // set area dirty here so that a dirty call is made
// upwards to us if the element is auto-positioned // upwards to us if the element is auto-positioned
element.SetAreaDirty(); element.SetAreaDirty();