Skip to content

Commit

Permalink
Merge pull request #30328 from TaterToes/seekingControlPointFix
Browse files Browse the repository at this point in the history
Add breathing room to seek back between control points in editor
  • Loading branch information
bdach authored Oct 22, 2024
2 parents 213be02 + 16bc188 commit 24dfc1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions osu.Game/Screens/Edit/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,12 @@ private void updateSampleDisabledState()

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)
Expand Down

0 comments on commit 24dfc1b

Please sign in to comment.