Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple moving circle not playing properly #548

Open
mattbeghin opened this issue Aug 19, 2023 · 1 comment
Open

Simple moving circle not playing properly #548

mattbeghin opened this issue Aug 19, 2023 · 1 comment

Comments

@mattbeghin
Copy link

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 ?

simple moving ellispe.json.zip

@mattbeghin
Copy link
Author

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

mattbeghin added a commit to mattbeghin/rlottie that referenced this issue Aug 21, 2023
Init keyframe end time with its start time, will be updated when parsing next key frame if any (solves issue interpolating to last keyframe) - Solves issue 548 Samsung#548
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant