mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:47:52 +08:00
Avoid applying mouse down effects to menu cursor when it isn't visible
Closes #16114.
This commit is contained in:
parent
aa0813ff05
commit
eecb1ce9f5
@ -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