From aecf1a565ecb58bbe1b8deb85b07c4ed3bc3f32f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 5 Nov 2019 13:50:01 +0100 Subject: [PATCH] fixed setheightbasedonchildren causing stack overflow on uneven resolutions --- 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 176a4da..a514d13 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -311,7 +311,7 @@ namespace MLEM.Ui.Elements { var lowest = this.GetLowestChild(e => !e.IsHidden); if (lowest != null) { var newHeight = (lowest.UnscrolledArea.Bottom - pos.Y + this.ScaledChildPadding.Y) / this.Scale; - if (newHeight != this.size.Y) { + if ((int) newHeight != (int) this.size.Y) { this.size.Y = newHeight; this.ForceUpdateArea(); }