1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:47:29 +08:00

Clamp X value to avoid excessive balance shift

This commit is contained in:
Joppe27 2024-06-13 18:06:19 +02:00
parent fdb63bd7cd
commit 47f89b8969

View File

@ -225,7 +225,7 @@ namespace osu.Game.Screens.Ranking
protected override void Update()
{
base.Update();
audioContent.Balance.Value = ((ScreenSpaceDrawQuad.Centre.X / game.ScreenSpaceDrawQuad.Width) * 2 - 1) * OsuGameBase.SFX_STEREO_STRENGTH;
audioContent.Balance.Value = (Math.Clamp(ScreenSpaceDrawQuad.Centre.X / game.ScreenSpaceDrawQuad.Width, -1, 1) * 2 - 1) * OsuGameBase.SFX_STEREO_STRENGTH;
}
private void playAppearSample()