From e63edf5b4914ec04f55b2de779709e2120d93315 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Apr 2021 23:50:09 +0900 Subject: [PATCH 1/2] Fix volume control displaying on non-vertical scroll events Closes #12475. --- osu.Game/Overlays/Volume/VolumeControlReceptor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Volume/VolumeControlReceptor.cs b/osu.Game/Overlays/Volume/VolumeControlReceptor.cs index 34b86b2f81..ae9c2eb394 100644 --- a/osu.Game/Overlays/Volume/VolumeControlReceptor.cs +++ b/osu.Game/Overlays/Volume/VolumeControlReceptor.cs @@ -44,6 +44,9 @@ namespace osu.Game.Overlays.Volume protected override bool OnScroll(ScrollEvent e) { + if (e.ScrollDelta.Y == 0) + return false; + // forward any unhandled mouse scroll events to the volume control. ScrollActionRequested?.Invoke(GlobalAction.IncreaseVolume, e.ScrollDelta.Y, e.IsPrecise); return true; From af79ad537c048891659eaabadaa3a1877b7aae89 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Apr 2021 23:51:37 +0900 Subject: [PATCH 2/2] Avoid unnecessary debounce triggers on zero-delta scrolls --- osu.Game/Overlays/Volume/VolumeMeter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Volume/VolumeMeter.cs b/osu.Game/Overlays/Volume/VolumeMeter.cs index 202eac93ea..f1f21bec49 100644 --- a/osu.Game/Overlays/Volume/VolumeMeter.cs +++ b/osu.Game/Overlays/Volume/VolumeMeter.cs @@ -245,6 +245,9 @@ namespace osu.Game.Overlays.Volume private void adjust(double delta, bool isPrecise) { + if (delta == 0) + return; + // every adjust increment increases the rate at which adjustments happen up to a cutoff. // this debounce will reset on inactivity. accelerationDebounce?.Cancel();