From b1ff703fe152b7de279b606565ac18fbb45009c9 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 29 Mar 2021 06:56:06 +0200 Subject: [PATCH] reintroduced tolerance for element size equality --- MLEM.Ui/Elements/Element.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index 0268443..449fe42 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Diagnostics; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -646,7 +645,7 @@ namespace MLEM.Ui.Elements { } if (this.TreatSizeAsMinimum) autoSize = Vector2.Max(autoSize, actualSize); - if (autoSize != this.Area.Size) { + if (!this.Area.Size.Equals(autoSize, 0.01F)) { recursion++; if (recursion >= 16) { throw new ArithmeticException($"The area of {this} with root {this.Root?.Name} has recursively updated too often. Does its child {foundChild} contain any conflicting auto-sizing settings?");