1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 19:13:22 +08:00

Merge pull request #30328 from TaterToes/seekingControlPointFix

Add breathing room to seek back between control points in editor
This commit is contained in:
Bartłomiej Dach 2024-10-22 13:14:24 +02:00 committed by GitHub
commit 24dfc1b66e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1098,8 +1098,12 @@ namespace osu.Game.Screens.Edit
private void seekControlPoint(int direction)
{
var found = direction < 1
? editorBeatmap.ControlPointInfo.AllControlPoints.LastOrDefault(p => p.Time < clock.CurrentTime)
// In the case of a backwards seek while playing, it can be hard to jump before a timing point.
// Adding some lenience here makes it more user-friendly.
double seekLenience = clock.IsRunning ? 1000 * ((IAdjustableClock)clock).Rate : 0;
ControlPoint found = direction < 1
? editorBeatmap.ControlPointInfo.AllControlPoints.LastOrDefault(p => p.Time < clock.CurrentTime - seekLenience)
: editorBeatmap.ControlPointInfo.AllControlPoints.FirstOrDefault(p => p.Time > clock.CurrentTime);
if (found != null)