mirror of
https://github.com/ppy/osu
synced 2024-12-29 02:12:43 +00:00
Merge pull request #16116 from peppy/dont-animate-menu-cursor-when-not-active
Avoid applying mouse down effects to menu cursor when it isn't visible
This commit is contained in:
commit
44485b4a86
@ -72,18 +72,21 @@ namespace osu.Game.Graphics.Cursor
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
// only trigger animation for main mouse buttons
|
||||
activeCursor.Scale = new Vector2(1);
|
||||
activeCursor.ScaleTo(0.90f, 800, Easing.OutQuint);
|
||||
|
||||
activeCursor.AdditiveLayer.Alpha = 0;
|
||||
activeCursor.AdditiveLayer.FadeInFromZero(800, Easing.OutQuint);
|
||||
|
||||
if (cursorRotate.Value && dragRotationState != DragRotationState.Rotating)
|
||||
if (State.Value == Visibility.Visible)
|
||||
{
|
||||
// if cursor is already rotating don't reset its rotate origin
|
||||
dragRotationState = DragRotationState.DragStarted;
|
||||
positionMouseDown = e.MousePosition;
|
||||
// only trigger animation for main mouse buttons
|
||||
activeCursor.Scale = new Vector2(1);
|
||||
activeCursor.ScaleTo(0.90f, 800, Easing.OutQuint);
|
||||
|
||||
activeCursor.AdditiveLayer.Alpha = 0;
|
||||
activeCursor.AdditiveLayer.FadeInFromZero(800, Easing.OutQuint);
|
||||
|
||||
if (cursorRotate.Value && dragRotationState != DragRotationState.Rotating)
|
||||
{
|
||||
// if cursor is already rotating don't reset its rotate origin
|
||||
dragRotationState = DragRotationState.DragStarted;
|
||||
positionMouseDown = e.MousePosition;
|
||||
}
|
||||
}
|
||||
|
||||
return base.OnMouseDown(e);
|
||||
|
Loading…
Reference in New Issue
Block a user