Only update timeline when default iterp type changed (fixes #127)

This commit is contained in:
Jonas Herzig
2020-04-15 17:40:26 +02:00
parent 6ccb576637
commit 4586cb5382

View File

@@ -105,9 +105,12 @@ public class SPTimeline implements PathingRegistry {
public void setDefaultInterpolatorType(InterpolatorType defaultInterpolatorType) {
Validate.isTrue(defaultInterpolatorType != InterpolatorType.DEFAULT, "Must not be DEFAULT");
InterpolatorType prevType = this.defaultInterpolatorType;
this.defaultInterpolatorType = Validate.notNull(defaultInterpolatorType);
timeline.pushChange(updateInterpolators());
if (prevType != null && prevType != this.defaultInterpolatorType) {
timeline.pushChange(updateInterpolators());
}
}
public Change setDefaultInterpolator(Interpolator interpolator) {