Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add breathing room to seek back between control points in editor #30328

Merged
merged 9 commits into from
Oct 22, 2024
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
Loading