From 88217e0c984b63a29e0c70bdf41372067743b7ea Mon Sep 17 00:00:00 2001 From: Susko3 Date: Mon, 23 May 2022 20:22:27 +0200 Subject: [PATCH 1/2] Adjust `ScrollDelta` usages to account for normalised `IsPrecise` values --- osu.Game/Overlays/Volume/VolumeMeter.cs | 2 +- osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs | 8 +++++--- osu.Game/Screens/Edit/Editor.cs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Volume/VolumeMeter.cs b/osu.Game/Overlays/Volume/VolumeMeter.cs index 46b8b35da2..929c362bd8 100644 --- a/osu.Game/Overlays/Volume/VolumeMeter.cs +++ b/osu.Game/Overlays/Volume/VolumeMeter.cs @@ -329,7 +329,7 @@ private void adjust(double delta, bool isPrecise) if (isPrecise) { - scrollAccumulation += delta * adjust_step * 0.1; + scrollAccumulation += delta * adjust_step; while (Precision.AlmostBigger(Math.Abs(scrollAccumulation), precision)) { diff --git a/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs b/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs index 5e6d9dbe34..27a3685f89 100644 --- a/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/DistancedHitObjectComposer.cs @@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Edit public abstract class DistancedHitObjectComposer : HitObjectComposer, IDistanceSnapProvider, IScrollBindingHandler where TObject : HitObject { + private const float adjust_step = 0.1f; + public Bindable DistanceSpacingMultiplier { get; } = new BindableDouble(1.0) { MinValue = 0.1, @@ -61,7 +63,7 @@ private void load() Child = distanceSpacingSlider = new ExpandableSlider> { Current = { BindTarget = DistanceSpacingMultiplier }, - KeyboardStep = 0.1f, + KeyboardStep = adjust_step, } } }); @@ -93,7 +95,7 @@ public bool OnPressed(KeyBindingPressEvent e) { case GlobalAction.EditorIncreaseDistanceSpacing: case GlobalAction.EditorDecreaseDistanceSpacing: - return adjustDistanceSpacing(e.Action, 0.1f); + return adjustDistanceSpacing(e.Action, adjust_step); } return false; @@ -109,7 +111,7 @@ public bool OnScroll(KeyBindingScrollEvent e) { 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; diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 0bb3f51903..eaacf74af3 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -540,7 +540,7 @@ protected override bool OnScroll(ScrollEvent e) 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) From d9ecf69d208e8754cec9dae644a827180e473722 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 27 May 2022 23:29:39 +0900 Subject: [PATCH 2/2] Update framework --- osu.Android.props | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Android.props b/osu.Android.props index aaea784852..c51919894e 100644 --- a/osu.Android.props +++ b/osu.Android.props @@ -52,7 +52,7 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5bc65ca507..8cf530ea3c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -35,7 +35,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/osu.iOS.props b/osu.iOS.props index 3597e7e5c0..79bd6bed9e 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -61,7 +61,7 @@ - + @@ -84,7 +84,7 @@ - +