mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 14:53:01 +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)
|
if (!track.IsLoaded)
|
||||||
return;
|
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()
|
private void scrollToTrackTime()
|
||||||
|
@ -43,18 +43,21 @@ namespace osu.Game.Screens.Edit
|
|||||||
{
|
{
|
||||||
base.ProcessFrame();
|
base.ProcessFrame();
|
||||||
|
|
||||||
var playbackAlreadyStopped = playbackFinished;
|
if (IsRunning)
|
||||||
playbackFinished = CurrentTime >= TrackLength;
|
|
||||||
|
|
||||||
if (playbackFinished && IsRunning)
|
|
||||||
{
|
{
|
||||||
if (!playbackAlreadyStopped)
|
var playbackAlreadyStopped = playbackFinished;
|
||||||
|
playbackFinished = CurrentTime >= TrackLength;
|
||||||
|
|
||||||
|
if (playbackFinished)
|
||||||
{
|
{
|
||||||
Stop();
|
if (!playbackAlreadyStopped)
|
||||||
Seek(TrackLength);
|
{
|
||||||
|
Stop();
|
||||||
|
Seek(TrackLength);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Seek(0);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Seek(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user