From 5e2f48db9dd1af5bad112d6f4b3876fdc11e6bfa Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 14 Oct 2023 17:53:23 +0200 Subject: [PATCH] further improved auto-hiding loop detection --- MLEM.Ui/Elements/Panel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 9d2f00f..d9afaac 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -114,11 +114,14 @@ namespace MLEM.Ui.Elements { if (child != this.ScrollBar && !child.Anchor.IsAuto()) throw new NotSupportedException($"A panel that handles overflow can't contain non-automatic anchors ({child})"); } + } + base.ForceUpdateArea(); + if (this.scrollOverflow) { for (var i = 0; i < this.scrollBarMaxHistory.Length; i++) this.scrollBarMaxHistory[i] = -1; } - base.ForceUpdateArea(); + this.SetScrollBarStyle(); }