1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 11:07:32 +08:00

Merge pull request #12476 from peppy/fix-volume-sideways-scroll

This commit is contained in:
Bartłomiej Dach 2021-04-18 18:34:43 +02:00 committed by GitHub
commit 0988af5449
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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();