mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
Adjust movement to look less sudden when snapping back to Y=0
This commit is contained in:
parent
e06a0f7300
commit
2476cf8fb3
@ -293,11 +293,13 @@ namespace osu.Game.Overlays.Notifications
|
||||
Vector2 change = e.MousePosition - e.MouseDownPosition;
|
||||
|
||||
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
|
||||
change *= change.Length <= 0 ? 0 : MathF.Pow(change.Length, 0.9f) / change.Length;
|
||||
change *= change.Length <= 0 ? 0 : MathF.Pow(change.Length, 0.8f) / change.Length;
|
||||
|
||||
// Only apply Y change if dragging to the left.
|
||||
if (change.X > 0)
|
||||
if (change.X >= 0)
|
||||
change.Y = 0;
|
||||
else
|
||||
change.Y *= (float)Interpolation.ApplyEasing(Easing.InOutQuart, Math.Min(1, -change.X / 200));
|
||||
|
||||
this.MoveTo(change);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user