mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 03:07:19 +08:00
prevent negative width on progress bar
This commit is contained in:
parent
95a1556376
commit
f86cb30e47
@ -15,6 +15,7 @@ using OpenTK;
|
|||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Game.Overlays.Direct;
|
using osu.Game.Overlays.Direct;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapSet
|
namespace osu.Game.Overlays.BeatmapSet
|
||||||
{
|
{
|
||||||
@ -82,7 +83,8 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
if (Playing.Value && preview != null)
|
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 = (float)Math.Max(preview.CurrentTime / preview.Length, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user