mirror of
https://github.com/ppy/osu
synced 2025-02-13 16:47:38 +00:00
use ternary expression
This commit is contained in:
parent
65bac6d31a
commit
56619ae926
@ -15,7 +15,6 @@ 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
|
||||||
{
|
{
|
||||||
@ -84,7 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
if (Playing.Value && preview != null)
|
if (Playing.Value && preview != null)
|
||||||
{
|
{
|
||||||
// prevent negative (potential infinite) width if a track without length was loaded
|
// prevent negative (potential infinite) width if a track without length was loaded
|
||||||
progress.Width = (float)Math.Max(preview.CurrentTime / preview.Length, 0);
|
progress.Width = preview.Length > 0 ? (float)(preview.CurrentTime / preview.Length) : 0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user