mirror of
https://github.com/ppy/osu
synced 2025-03-11 05:49:12 +00:00
Clamp at the end points.
This commit is contained in:
parent
04c3801fcc
commit
722b7419d6
@ -8,6 +8,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
@ -171,11 +172,17 @@ namespace osu.Game.Overlays.Music
|
|||||||
|
|
||||||
if (localPos.Y < start_offset)
|
if (localPos.Y < start_offset)
|
||||||
{
|
{
|
||||||
|
if (Current <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
var power = Math.Min(max_power, Math.Abs(start_offset - localPos.Y));
|
var power = Math.Min(max_power, Math.Abs(start_offset - localPos.Y));
|
||||||
ScrollBy(-(float)Math.Pow(exp_base, power));
|
ScrollBy(-(float)Math.Pow(exp_base, power));
|
||||||
}
|
}
|
||||||
else if (localPos.Y > DrawHeight - start_offset)
|
else if (localPos.Y > DrawHeight - start_offset)
|
||||||
{
|
{
|
||||||
|
if (IsScrolledToEnd())
|
||||||
|
return;
|
||||||
|
|
||||||
var power = Math.Min(max_power, Math.Abs(DrawHeight - start_offset - localPos.Y));
|
var power = Math.Min(max_power, Math.Abs(DrawHeight - start_offset - localPos.Y));
|
||||||
ScrollBy((float)Math.Pow(exp_base, power));
|
ScrollBy((float)Math.Pow(exp_base, power));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user