mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:02:59 +08:00
Fix adjustment not working when dragged before object
This commit is contained in:
parent
c138e3907e
commit
6ae0efa40d
@ -275,18 +275,18 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
case IHasRepeats repeatHitObject:
|
case IHasRepeats repeatHitObject:
|
||||||
// find the number of repeats which can fit in the requested time.
|
// find the number of repeats which can fit in the requested time.
|
||||||
var lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
|
var lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
|
||||||
var proposedCount = (int)((time - hitObject.StartTime) / lengthOfOneRepeat) - 1;
|
var proposedCount = Math.Max(0, (int)((time - hitObject.StartTime) / lengthOfOneRepeat) - 1);
|
||||||
|
|
||||||
if (proposedCount == repeatHitObject.RepeatCount || proposedCount < 0)
|
if (proposedCount == repeatHitObject.RepeatCount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
repeatHitObject.RepeatCount = proposedCount;
|
repeatHitObject.RepeatCount = proposedCount;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IHasEndTime endTimeHitObject:
|
case IHasEndTime endTimeHitObject:
|
||||||
var snappedTime = beatSnapProvider.SnapTime(time);
|
var snappedTime = Math.Max(hitObject.StartTime, beatSnapProvider.SnapTime(time));
|
||||||
|
|
||||||
if (endTimeHitObject.EndTime == snappedTime || snappedTime <= hitObject.StartTime)
|
if (endTimeHitObject.EndTime == snappedTime)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
endTimeHitObject.EndTime = snappedTime;
|
endTimeHitObject.EndTime = snappedTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user