mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Clamp at the end points.
This commit is contained in:
@ -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));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user