For some keyframes the cache function was not getting called.
so move the cache logic to outer function and call it when the property
is fully parsed.
VPointF mEndValue;
VPointF mInTangent;
VPointF mOutTangent;
- float mBezierLength;
- bool mPathKeyFrame = false;
+ float mBezierLength{0};
+ bool mPathKeyFrame{false};
void cache() {
if (mPathKeyFrame) {
(last < prevFrame && last < curFrame));
}
+ void cache() { for (auto &e : mKeyFrames) e.mValue.cache(); }
+
public:
std::vector<KeyFrame<T>> mKeyFrames;
};
return isStatic() ? false : animation().changed(prevFrame, curFrame);
}
+ void cache() { if (!isStatic()) animation().cache();}
private:
template <typename Tp>
void construct(Tp &member, Tp &&val)
inTangent, outTangent, std::move(parsed.interpolatorKey));
list.push_back(std::move(keyframe));
} else {
- // Last frame. cache some computaion
- for (auto &e : list) e.mValue.cache();
+ // Last frame ignore
}
}
Skip(nullptr);
}
}
+ obj.cache();
}
template <typename T>
break;
}
}
+ obj.cache();
}
}