Properly set previousCallLinear value in KeyframeList#getInterpolatedValueForPathPosition(), MASSIVELY increasing performance as the interpolation isn't recalculated all the time

This commit is contained in:
CrushedPixel
2015-07-20 01:17:52 +02:00
parent d9e2c2a7c8
commit a9d7e0f794

View File

@@ -161,6 +161,8 @@ public class KeyframeList<K extends KeyframeValue> extends ArrayList<Keyframe<K>
K toApply = (K) first().getValue().newInstance(); K toApply = (K) first().getValue().newInstance();
if(previousCallLinear != (Boolean)linear) { if(previousCallLinear != (Boolean)linear) {
previousCallLinear = linear;
interpolation = linear ? new GenericLinearInterpolation<K>() : new GenericSplineInterpolation<K>(); interpolation = linear ? new GenericLinearInterpolation<K>() : new GenericSplineInterpolation<K>();
for(Keyframe<K> keyframe : this) { for(Keyframe<K> keyframe : this) {