1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

fix crash from dragging near zero-length repeating object in timeline

This commit is contained in:
OliBomby 2023-12-19 21:20:45 +01:00
parent ec578e1d9f
commit c167f10ad5

View File

@ -409,7 +409,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
double lengthOfOneRepeat = repeatHitObject.Duration / (repeatHitObject.RepeatCount + 1);
int proposedCount = Math.Max(0, (int)Math.Round(proposedDuration / lengthOfOneRepeat) - 1);
if (proposedCount == repeatHitObject.RepeatCount || lengthOfOneRepeat == 0)
if (proposedCount == repeatHitObject.RepeatCount || Precision.AlmostEquals(lengthOfOneRepeat, 0))
return;
repeatHitObject.RepeatCount = proposedCount;