Fix negative spinners

This commit is contained in:
Dean Herbert 2020-02-05 16:35:07 +09:00
parent 3d42973764
commit 98ab1f9862
1 changed files with 9 additions and 1 deletions

View File

@ -156,6 +156,9 @@ private void updateState()
[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 @@ protected override void OnDrag(DragEvent e)
break;
case IHasEndTime endTimeHitObject:
endTimeHitObject.EndTime = time;
var snappedTime = beatSnapProvider.SnapTime(time);
if (endTimeHitObject.EndTime == snappedTime || snappedTime <= hitObject.StartTime)
return;
endTimeHitObject.EndTime = snappedTime;
break;
}