1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 17:27:48 +08:00

Fix off-by-one display issue when adjusting offset

This commit is contained in:
Dean Herbert 2022-05-31 18:17:08 +09:00
parent 94194a04f2
commit 475cc8174f

View File

@ -123,13 +123,7 @@ namespace osu.Game.Screens.Edit.Timing
beatLength.BindTo(timingPoint.BeatLengthBindable); beatLength.BindTo(timingPoint.BeatLengthBindable);
double? newStartTime = selectedGroup.Value?.Time; double? newStartTime = selectedGroup.Value?.Time;
double? offsetChange = newStartTime - selectedGroupStartTime;
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);
}
var nextGroup = editorBeatmap.ControlPointInfo.TimingPoints var nextGroup = editorBeatmap.ControlPointInfo.TimingPoints
.SkipWhile(g => g != tcp) .SkipWhile(g => g != tcp)
@ -138,6 +132,13 @@ namespace osu.Game.Screens.Edit.Timing
selectedGroupStartTime = newStartTime ?? 0; selectedGroupStartTime = newStartTime ?? 0;
selectedGroupEndTime = nextGroup?.Time ?? beatmap.Value.Track.Length; 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; protected override bool OnHover(HoverEvent e) => true;