1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 12:47:25 +08:00

Fix seeking back to beginning too early

This commit is contained in:
voidedWarranties 2020-03-23 22:37:53 -07:00
parent a38c912c6d
commit b41f3f1cad
2 changed files with 15 additions and 10 deletions

View File

@ -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()

View File

@ -43,18 +43,21 @@ namespace osu.Game.Screens.Edit
{
base.ProcessFrame();
var playbackAlreadyStopped = playbackFinished;
playbackFinished = CurrentTime >= TrackLength;
if (playbackFinished && IsRunning)
if (IsRunning)
{
if (!playbackAlreadyStopped)
var playbackAlreadyStopped = playbackFinished;
playbackFinished = CurrentTime >= TrackLength;
if (playbackFinished)
{
Stop();
Seek(TrackLength);
if (!playbackAlreadyStopped)
{
Stop();
Seek(TrackLength);
}
else
Seek(0);
}
else
Seek(0);
}
}