Add support for weird storyboards which have backwards events

Closes https://github.com/ppy/osu/issues/20632.
Not adding test coverage because this is just weird.
This commit is contained in:
Dean Herbert 2022-10-10 16:51:50 +09:00
parent e57819d687
commit 28185178d6
1 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,10 @@ public class CommandTimeline<T> : ICommandTimeline
public void Add(Easing easing, double startTime, double endTime, T startValue, T endValue)
{
if (endTime < startTime)
return;
{
(startTime, endTime) = (endTime, startTime);
(startValue, endValue) = (endValue, startValue);
}
commands.Add(new TypedCommand { Easing = easing, StartTime = startTime, EndTime = endTime, StartValue = startValue, EndValue = endValue });