mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:05:34 +08:00
Fix seeking back to beginning too early
This commit is contained in:
parent
a38c912c6d
commit
b41f3f1cad
@ -130,7 +130,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
if (!track.IsLoaded)
|
||||
return;
|
||||
|
||||
adjustableClock.Seek(Current / Content.DrawWidth * track.Length);
|
||||
double target = Current / Content.DrawWidth * track.Length;
|
||||
|
||||
adjustableClock.Seek(Math.Min(track.Length, target));
|
||||
}
|
||||
|
||||
private void scrollToTrackTime()
|
||||
|
@ -43,10 +43,12 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
base.ProcessFrame();
|
||||
|
||||
if (IsRunning)
|
||||
{
|
||||
var playbackAlreadyStopped = playbackFinished;
|
||||
playbackFinished = CurrentTime >= TrackLength;
|
||||
|
||||
if (playbackFinished && IsRunning)
|
||||
if (playbackFinished)
|
||||
{
|
||||
if (!playbackAlreadyStopped)
|
||||
{
|
||||
@ -57,6 +59,7 @@ namespace osu.Game.Screens.Edit
|
||||
Seek(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Seek to the closest snappable beat from a time.
|
||||
|
Loading…
Reference in New Issue
Block a user