From 2ef843261ba3a9176394c86bfe50f12d84ca4320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 21 Jul 2023 19:08:40 +0200 Subject: [PATCH] Adjust failing test after metrics changes --- .../Visual/Editing/TestSceneHitObjectComposer.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneHitObjectComposer.cs b/osu.Game.Tests/Visual/Editing/TestSceneHitObjectComposer.cs index 9bdb9a513c..a38c481003 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneHitObjectComposer.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneHitObjectComposer.cs @@ -117,9 +117,9 @@ public void TestPlacementFailsWhenClickingButton() AddStep("move mouse to overlapping toggle button", () => { var playfield = hitObjectComposer.Playfield.ScreenSpaceDrawQuad; - var button = toolboxContainer.ChildrenOfType().First(b => playfield.Contains(b.ScreenSpaceDrawQuad.Centre)); + var button = toolboxContainer.ChildrenOfType().First(b => playfield.Contains(getOverlapPoint(b))); - InputManager.MoveMouseTo(button); + InputManager.MoveMouseTo(getOverlapPoint(button)); }); AddAssert("no circles placed", () => editorBeatmap.HitObjects.Count == 0); @@ -127,6 +127,12 @@ public void TestPlacementFailsWhenClickingButton() AddStep("attempt place circle", () => InputManager.Click(MouseButton.Left)); AddAssert("no circles placed", () => editorBeatmap.HitObjects.Count == 0); + + Vector2 getOverlapPoint(DrawableTernaryButton ternaryButton) + { + var quad = ternaryButton.ScreenSpaceDrawQuad; + return quad.TopLeft + new Vector2(quad.Width * 9 / 10, quad.Height / 2); + } } [Test]