mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 08:22:56 +08: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)
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
{
|
{
|
||||||
// only trigger animation for main mouse buttons
|
if (State.Value == Visibility.Visible)
|
||||||
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
|
// only trigger animation for main mouse buttons
|
||||||
dragRotationState = DragRotationState.DragStarted;
|
activeCursor.Scale = new Vector2(1);
|
||||||
positionMouseDown = e.MousePosition;
|
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);
|
return base.OnMouseDown(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user