mirror of
https://github.com/osukey/osukey.git
synced 2025-07-23 19:30:06 +09:00
Improve precision wheel adjustment handling
This commit is contained in:
@ -206,11 +206,18 @@ namespace osu.Game.Overlays.Volume
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// because volume precision is set to 0.01, this local is required to keep track of more precise adjustments and only apply when possible.
|
||||||
|
private double scrollAmount;
|
||||||
|
|
||||||
protected override bool OnScroll(InputState state)
|
protected override bool OnScroll(InputState state)
|
||||||
{
|
{
|
||||||
double amount = adjust_step * state.Mouse.ScrollDelta.Y * (state.Mouse.HasPreciseScroll ? 0.5f : 1);
|
scrollAmount += adjust_step * state.Mouse.ScrollDelta.Y * (state.Mouse.HasPreciseScroll ? 0.1f : 1);
|
||||||
|
|
||||||
Volume += Math.Sign(amount) * Math.Max(0.01, Math.Abs(amount));
|
if (Math.Abs(scrollAmount) < Bindable.Precision)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
Volume += scrollAmount;
|
||||||
|
scrollAmount = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user