1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:43:22 +08:00

Ensure arithmetic declares precedence

This commit is contained in:
Mike Will 2025-01-12 21:06:28 -05:00
parent ec861080dd
commit 6d8516aef8
2 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Toolbar
base.LoadComplete();
globalVolume = audio.Volume.Scaled.GetBoundCopy();
globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)(1 - v.NewValue / VolumeScaler.MIN), 200, Easing.OutQuint), true);
globalVolume.BindValueChanged(v => volumeBar.ResizeHeightTo((float)(1 - (v.NewValue / VolumeScaler.MIN)), 200, Easing.OutQuint), true);
}
protected override bool OnKeyDown(KeyDownEvent e)

View File

@ -252,7 +252,7 @@ namespace osu.Game.Overlays.Volume
get => displayVolume;
set
{
percentage = 1 - value / VolumeScaler.MIN;
percentage = 1 - (value / VolumeScaler.MIN);
int step = (int)Math.Round(value / adjust_step);
bool stepChanged = step != currentStep;
@ -288,7 +288,7 @@ namespace osu.Game.Overlays.Volume
var channel = notchSample.GetChannel();
channel.Frequency.Value = 0.99f + RNG.NextDouble(0.02f) + percentage * 0.1f;
channel.Frequency.Value = 0.99f + RNG.NextDouble(0.02f) + (percentage * 0.1f);
// intentionally pitched down, even when hitting max.
if (currentStep == step_min || currentStep == step_max)