From 9c91f16e3a2425f248a5d040525322737fd639ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 5 Nov 2020 17:24:59 +0900 Subject: [PATCH] Update sizing as early as possible in addition to scheduling (to handle any dependent edge cases) --- osu.Game/Tests/Visual/SkinnableTestScene.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/Tests/Visual/SkinnableTestScene.cs b/osu.Game/Tests/Visual/SkinnableTestScene.cs index 07e45f25cf..d5fcf8bae3 100644 --- a/osu.Game/Tests/Visual/SkinnableTestScene.cs +++ b/osu.Game/Tests/Visual/SkinnableTestScene.cs @@ -112,7 +112,15 @@ namespace osu.Game.Tests.Visual } }; - Schedule(() => + // run this once initially to bring things into a sane state as early as possible. + updateSizing(); + + // run this once after construction to handle the case the changes are made in a BDL/LoadComplete call. + Schedule(updateSizing); + + return children; + + void updateSizing() { var autoSize = created.RelativeSizeAxes == Axes.None; @@ -123,9 +131,7 @@ namespace osu.Game.Tests.Visual } outlineBox.Alpha = autoSize ? 1 : 0; - }); - - return children; + } } ///