From 38847c3ac5383c9fb69b7bf0b38aa8ea36b23b39 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2023 17:23:01 +0900 Subject: [PATCH] Change test to move only on a toggle step --- osu.Game.Tests/Visual/Online/TestSceneGraph.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneGraph.cs b/osu.Game.Tests/Visual/Online/TestSceneGraph.cs index eee29e0aeb..f4bde159e5 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneGraph.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneGraph.cs @@ -13,10 +13,10 @@ namespace osu.Game.Tests.Visual.Online [TestFixture] public partial class TestSceneGraph : OsuTestScene { - private readonly BarGraph graph; - public TestSceneGraph() { + BarGraph graph; + Child = graph = new BarGraph { RelativeSizeAxes = Axes.Both, @@ -34,13 +34,14 @@ public TestSceneGraph() AddStep("Top to bottom", () => graph.Direction = BarDirection.TopToBottom); AddStep("Left to right", () => graph.Direction = BarDirection.LeftToRight); AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft); - } - protected override void LoadComplete() - { - base.LoadComplete(); - - graph.MoveToY(-10, 1000).Then().MoveToY(10, 1000).Loop(); + AddToggleStep("Toggle movement", enabled => + { + if (enabled) + graph.MoveToY(-10, 1000).Then().MoveToY(10, 1000).Loop(); + else + graph.ClearTransforms(); + }); } } }