1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 09:22:54 +08:00

Fix negative spinners

This commit is contained in:
Dean Herbert 2020-02-05 16:35:07 +09:00
parent 3d42973764
commit 98ab1f9862

View File

@ -156,6 +156,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
[Resolved]
private EditorBeatmap beatmap { get; set; }
[Resolved]
private IBeatSnapProvider beatSnapProvider { get; set; }
protected override void OnDrag(DragEvent e)
{
base.OnDrag(e);
@ -178,7 +181,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
break;
case IHasEndTime endTimeHitObject:
endTimeHitObject.EndTime = time;
var snappedTime = beatSnapProvider.SnapTime(time);
if (endTimeHitObject.EndTime == snappedTime || snappedTime <= hitObject.StartTime)
return;
endTimeHitObject.EndTime = snappedTime;
break;
}