1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Merge pull request #1926 from Aergwyn/preview-fixes

Minor preview fixes
This commit is contained in:
Dan Balasescu 2018-01-19 00:12:41 +09:00 committed by GitHub
commit 64c32f5715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -82,7 +82,8 @@ namespace osu.Game.Overlays.BeatmapSet
if (Playing.Value && preview != null)
{
progress.Width = (float)(preview.CurrentTime / preview.Length);
// prevent negative (potential infinite) width if a track without length was loaded
progress.Width = preview.Length > 0 ? (float)(preview.CurrentTime / preview.Length) : 0f;
}
}

View File

@ -150,7 +150,12 @@ namespace osu.Game.Overlays.Direct
private void beginAudioLoad()
{
if (trackLoader != null) return;
if (trackLoader != null)
{
Preview = trackLoader.Preview;
Playing.TriggerChange();
return;
}
loading = true;