rlottie
rlottie copied to clipboard
Simple moving circle not playing properly
Sorry if I'm missing something stupid. I have a very simple file which rlottie is unable to play. It's a single shape layer with an ellipse, and with just two key frames to animate the position. It works fine in https://lottiefiles.github.io/lottie-docs/playground/json_editor/ With rlottie it plays first frame correctly then the ellipse goes to 0,0 instead of following the positions of the keyframes.
Any idea why this one doesn't work ?
I could solve the issue, the problem is that the last keyframe end time is not set in LottieParserImpl::parseKeyFrame. The keyframe end time is set when parsing the next keyframe so last one is no set. Then KeyFrames::value(int frameNo) does this test: if (frames_.back().end_ <= frameNo) return frames_.back().value_.end_; So it doesn't interpolate. I could solve the issue setting the keyframe end time to its start time when parsing. I will make a pull request