Skip to content

Commit 3b9b030

Browse files
authored
Merge pull request #36161 from peppy/editor-no-smooth-seeking
Change editor to not seek smoothly when performing distant seeks
2 parents 4e83814 + 8347f83 commit 3b9b030

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void seekToPosition(Vector2 screenPosition, bool instant)
7070
if (editorClock.IsRunning && !instant && lastSeekTime != null && Time.Current - lastSeekTime < NowPlayingOverlay.TRACK_DRAG_SEEK_DEBOUNCE)
7171
return;
7272

73-
editorClock.SeekSmoothlyTo(seekDestination);
73+
editorClock.Seek(seekDestination);
7474

7575
lastSeekTime = instant ? null : Time.Current;
7676
}

osu.Game/Screens/Edit/EditorClock.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,25 @@ public bool Seek(double position)
209209
}
210210

211211
/// <summary>
212-
/// Seek smoothly to the provided destination.
212+
/// Seek smoothly to the provided destination, if within a certain proximity to the current viewport.
213213
/// Use <see cref="Seek"/> to perform an immediate seek.
214214
/// </summary>
215215
/// <param name="seekDestination"></param>
216216
public void SeekSmoothlyTo(double seekDestination)
217217
{
218218
seekingOrStopped.Value = true;
219219

220-
if (IsRunning)
221-
Seek(seekDestination);
222-
else
220+
// The whole point of seeking smoothly is to maintain continuity for the user.
221+
// Above a certain proximity, there's little reason to do this as the jump is already huge.
222+
const double smooth_seek_max_proximity = 5000;
223+
224+
if (IsRunning || Math.Abs(seekDestination - currentTime) > smooth_seek_max_proximity)
223225
{
224-
transformSeekTo(seekDestination, transform_time, Easing.OutQuint);
226+
Seek(seekDestination);
227+
return;
225228
}
229+
230+
transformSeekTo(seekDestination, transform_time, Easing.OutQuint);
226231
}
227232

228233
public void BindAdjustments() => track.Value?.BindAdjustments(AudioAdjustments);

0 commit comments

Comments
 (0)