From 1bbb12a1fae0aa9b08f0ad460b0c11604d689ebf Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 9 Sep 2021 17:02:29 +0200 Subject: [PATCH] clarified auto-size exception in elements --- MLEM.Ui/Elements/Element.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index ac01556..d2c9b69 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -650,7 +650,7 @@ namespace MLEM.Ui.Elements { foundChild = lowest; } else { if (this.Children.Any(e => !e.IsHidden)) - throw new InvalidOperationException($"{this} with root {this.Root.Name} sets its height based on children but it only has children anchored too low ({string.Join(", ", this.Children.Select(c => c.Anchor))})"); + throw new InvalidOperationException($"{this} with root {this.Root.Name} sets its height based on children but it only has visible children anchored too low ({string.Join(", ", this.Children.Where(c => !c.IsHidden).Select(c => c.Anchor))})"); autoSize.Y = 0; } } @@ -662,7 +662,7 @@ namespace MLEM.Ui.Elements { foundChild = rightmost; } else { if (this.Children.Any(e => !e.IsHidden)) - throw new InvalidOperationException($"{this} with root {this.Root.Name} sets its width based on children but it only has children anchored too far right ({string.Join(", ", this.Children.Select(c => c.Anchor))})"); + throw new InvalidOperationException($"{this} with root {this.Root.Name} sets its width based on children but it only has visible children anchored too far right ({string.Join(", ", this.Children.Where(c => !c.IsHidden).Select(c => c.Anchor))})"); autoSize.X = 0; } }