diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index c47b6d0..422209d 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -212,7 +212,7 @@ namespace MLEM.Ui.Elements { public void SetAreaDirty() { this.areaDirty = true; - if (this.Anchor >= Anchor.AutoLeft && this.Parent != null) + if (this.Parent != null && (this.Anchor >= Anchor.AutoLeft || this.Parent.SetWidthBasedOnChildren || this.Parent.SetHeightBasedOnChildren)) this.Parent.SetAreaDirty(); } diff --git a/MLEM.Ui/Elements/Tooltip.cs b/MLEM.Ui/Elements/Tooltip.cs index fda0a3e..bc9d30f 100644 --- a/MLEM.Ui/Elements/Tooltip.cs +++ b/MLEM.Ui/Elements/Tooltip.cs @@ -35,6 +35,7 @@ namespace MLEM.Ui.Elements { public override void Update(GameTime time) { base.Update(time); this.SnapPositionToMouse(); + this.UpdateAreaIfDirty(); } public override void ForceUpdateArea() { @@ -64,5 +65,6 @@ namespace MLEM.Ui.Elements { offset.Y = (viewport.Y - this.Area.Height) / this.Scale; this.PositionOffset = offset; } + } } \ No newline at end of file