mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 14:52:56 +08:00
Ensure arithmetic declares precedence
This commit is contained in:
parent
ec861080dd
commit
6d8516aef8
@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
globalVolume = audio.Volume.Scaled.GetBoundCopy();
|
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)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
@ -252,7 +252,7 @@ namespace osu.Game.Overlays.Volume
|
|||||||
get => displayVolume;
|
get => displayVolume;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
percentage = 1 - value / VolumeScaler.MIN;
|
percentage = 1 - (value / VolumeScaler.MIN);
|
||||||
|
|
||||||
int step = (int)Math.Round(value / adjust_step);
|
int step = (int)Math.Round(value / adjust_step);
|
||||||
bool stepChanged = step != currentStep;
|
bool stepChanged = step != currentStep;
|
||||||
@ -288,7 +288,7 @@ namespace osu.Game.Overlays.Volume
|
|||||||
|
|
||||||
var channel = notchSample.GetChannel();
|
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.
|
// intentionally pitched down, even when hitting max.
|
||||||
if (currentStep == step_min || currentStep == step_max)
|
if (currentStep == step_min || currentStep == step_max)
|
||||||
|
Loading…
Reference in New Issue
Block a user