Adjust ScrollDelta usages to account for normalised IsPrecise values

This commit is contained in:
Susko3 2022-05-23 20:22:27 +02:00
parent 7d93778355
commit 88217e0c98
3 changed files with 7 additions and 5 deletions

View File

@ -329,7 +329,7 @@ namespace osu.Game.Overlays.Volume
if (isPrecise)
{
scrollAccumulation += delta * adjust_step * 0.1;
scrollAccumulation += delta * adjust_step;
while (Precision.AlmostBigger(Math.Abs(scrollAccumulation), precision))
{

View File

@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Edit
public abstract class DistancedHitObjectComposer<TObject> : HitObjectComposer<TObject>, IDistanceSnapProvider, IScrollBindingHandler<GlobalAction>
where TObject : HitObject
{
private const float adjust_step = 0.1f;
public Bindable<double> DistanceSpacingMultiplier { get; } = new BindableDouble(1.0)
{
MinValue = 0.1,
@ -61,7 +63,7 @@ namespace osu.Game.Rulesets.Edit
Child = distanceSpacingSlider = new ExpandableSlider<double, SizeSlider<double>>
{
Current = { BindTarget = DistanceSpacingMultiplier },
KeyboardStep = 0.1f,
KeyboardStep = adjust_step,
}
}
});
@ -93,7 +95,7 @@ namespace osu.Game.Rulesets.Edit
{
case GlobalAction.EditorIncreaseDistanceSpacing:
case GlobalAction.EditorDecreaseDistanceSpacing:
return adjustDistanceSpacing(e.Action, 0.1f);
return adjustDistanceSpacing(e.Action, adjust_step);
}
return false;
@ -109,7 +111,7 @@ namespace osu.Game.Rulesets.Edit
{
case GlobalAction.EditorIncreaseDistanceSpacing:
case GlobalAction.EditorDecreaseDistanceSpacing:
return adjustDistanceSpacing(e.Action, e.ScrollAmount * (e.IsPrecise ? 0.01f : 0.1f));
return adjustDistanceSpacing(e.Action, e.ScrollAmount * adjust_step);
}
return false;

View File

@ -540,7 +540,7 @@ namespace osu.Game.Screens.Edit
if (scrollAccumulation != 0 && Math.Sign(scrollAccumulation) != scrollDirection)
scrollAccumulation = scrollDirection * (precision - Math.Abs(scrollAccumulation));
scrollAccumulation += scrollComponent * (e.IsPrecise ? 0.1 : 1);
scrollAccumulation += scrollComponent;
// because we are doing snapped seeking, we need to add up precise scrolls until they accumulate to an arbitrary cut-off.
while (Math.Abs(scrollAccumulation) >= precision)