Fix volume metre not correctly showing volume when initially zero

Closes https://github.com/ppy/osu/issues/13761.
This commit is contained in:
Dean Herbert 2021-07-04 14:56:15 +09:00
parent 49090a0d1b
commit 149a200f34

View File

@ -191,7 +191,7 @@ namespace osu.Game.Overlays.Volume
bgProgress.Current.Value = 0.75f;
}
private int displayVolumeInt;
private int? displayVolumeInt;
private double displayVolume;
@ -200,9 +200,6 @@ namespace osu.Game.Overlays.Volume
get => displayVolume;
set
{
if (value == displayVolume)
return;
displayVolume = value;
int intValue = (int)Math.Round(displayVolume * 100);
@ -218,7 +215,7 @@ namespace osu.Game.Overlays.Volume
else
{
maxGlow.EffectColour = Color4.Transparent;
text.Text = displayVolumeInt.ToString(CultureInfo.CurrentCulture);
text.Text = intValue.ToString(CultureInfo.CurrentCulture);
}
volumeCircle.Current.Value = displayVolume * 0.75f;