mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 00:43:25 +08:00
Ensure offset changes are correctly tracked by the display, even when locked
This commit is contained in:
parent
c8f21ee8b2
commit
51014b8748
@ -107,29 +107,37 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
{
|
{
|
||||||
beatLength.UnbindBindings();
|
beatLength.UnbindBindings();
|
||||||
|
|
||||||
selectedGroupStartTime = 0;
|
|
||||||
selectedGroupEndTime = beatmap.Value.Track.Length;
|
|
||||||
|
|
||||||
var tcp = selectedGroup.Value?.ControlPoints.OfType<TimingControlPoint>().FirstOrDefault();
|
var tcp = selectedGroup.Value?.ControlPoints.OfType<TimingControlPoint>().FirstOrDefault();
|
||||||
|
|
||||||
if (tcp == null)
|
if (tcp == null)
|
||||||
{
|
{
|
||||||
timingPoint = new TimingControlPoint();
|
timingPoint = new TimingControlPoint();
|
||||||
|
// During movement of a control point's offset, this clause can be hit momentarily.
|
||||||
|
// We don't want to reset the `selectedGroupStartTime` here as we rely on having the
|
||||||
|
// last value to perform an offset traversal below.
|
||||||
|
selectedGroupEndTime = beatmap.Value.Track.Length;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
timingPoint = tcp;
|
timingPoint = tcp;
|
||||||
beatLength.BindTo(timingPoint.BeatLengthBindable);
|
beatLength.BindTo(timingPoint.BeatLengthBindable);
|
||||||
|
|
||||||
selectedGroupStartTime = selectedGroup.Value?.Time ?? 0;
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
var nextGroup = editorBeatmap.ControlPointInfo.TimingPoints
|
var nextGroup = editorBeatmap.ControlPointInfo.TimingPoints
|
||||||
.SkipWhile(g => g != tcp)
|
.SkipWhile(g => g != tcp)
|
||||||
.Skip(1)
|
.Skip(1)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
if (nextGroup != null)
|
selectedGroupStartTime = newStartTime ?? 0;
|
||||||
selectedGroupEndTime = nextGroup.Time;
|
selectedGroupEndTime = nextGroup?.Time ?? beatmap.Value.Track.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e) => true;
|
protected override bool OnHover(HoverEvent e) => true;
|
||||||
|
Loading…
Reference in New Issue
Block a user