From cd70b22ae55f3fcfd45541a0d443d6d8bd0844b4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 17 Mar 2020 22:27:39 +0100 Subject: [PATCH] made elements refer back to their controls for the selected element --- MLEM.Ui/Elements/Element.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index b545b3d..f48fd4a 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -472,7 +472,7 @@ namespace MLEM.Ui.Elements { public virtual void Draw(GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix) { this.System.OnElementDrawn?.Invoke(this, time, batch, alpha); - if (this.Root.SelectedElement == this) + if (this.Controls.SelectedElement == this) this.System.OnSelectedElementDrawn?.Invoke(this, time, batch, alpha); foreach (var child in this.GetRelevantChildren()) {