mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 12:27:26 +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:
commit
24dfc1b66e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user