From 475cc8174ff036f626f883ab6a75774c960a5e74 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 May 2022 18:17:08 +0900 Subject: [PATCH] Fix off-by-one display issue when adjusting offset --- .../Edit/Timing/WaveformComparisonDisplay.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs index 172f0ac9b1..ce13a8a244 100644 --- a/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs +++ b/osu.Game/Screens/Edit/Timing/WaveformComparisonDisplay.cs @@ -123,13 +123,7 @@ namespace osu.Game.Screens.Edit.Timing beatLength.BindTo(timingPoint.BeatLengthBindable); double? newStartTime = selectedGroup.Value?.Time; - - if (newStartTime.HasValue && selectedGroupStartTime != newStartTime) - { - // The offset of the selected point may have changed. - // This handles the case the user has locked the view and expects the display to update with this change. - showFromTime(displayedTime + (newStartTime.Value - selectedGroupStartTime), true); - } + double? offsetChange = newStartTime - selectedGroupStartTime; var nextGroup = editorBeatmap.ControlPointInfo.TimingPoints .SkipWhile(g => g != tcp) @@ -138,6 +132,13 @@ namespace osu.Game.Screens.Edit.Timing selectedGroupStartTime = newStartTime ?? 0; selectedGroupEndTime = nextGroup?.Time ?? beatmap.Value.Track.Length; + + if (newStartTime.HasValue && offsetChange.HasValue) + { + // The offset of the selected point may have changed. + // This handles the case the user has locked the view and expects the display to update with this change. + showFromTime(displayedTime + offsetChange.Value, true); + } } protected override bool OnHover(HoverEvent e) => true;