diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs index 20e6103436..363f6b53f0 100644 --- a/osu.Game.Tests/Visual/TestCaseCursors.cs +++ b/osu.Game.Tests/Visual/TestCaseCursors.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -81,10 +82,14 @@ namespace osu.Game.Tests.Visual }; returnUserInput(); + + AddToggleStep("Smooth transitions", b => cursorBoxes.ForEach(box => box.SmoothTransition = b)); + testUserCursor(); testLocalCursor(); testUserCursorOverride(); testMultipleLocalCursors(); + returnUserInput(); } /// @@ -196,9 +201,13 @@ namespace osu.Game.Tests.Visual private class CustomCursorBox : Container, IProvideCursor { + public bool SmoothTransition; + public CursorContainer Cursor { get; } public bool ProvidingUserCursor { get; } + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || SmoothTransition && !ProvidingUserCursor; + private readonly Box background; public CustomCursorBox(Color4 cursorColour, bool providesUserCursor = true)