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

Fix one frame missing #529

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lottie/lottieitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ VMatrix renderer::Layer::matrix(int frameNo) const
bool renderer::Layer::visible() const
{
return (frameNo() >= mLayerData->inFrame() &&
frameNo() < mLayerData->outFrame());
frameNo() <= mLayerData->outFrame());
}

void renderer::Layer::preprocess(const VRect &clip)
Expand Down
4 changes: 2 additions & 2 deletions src/lottie/lottiemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ class Composition : public Object {
{
return long(frameAtPos(timeInSec / duration()));
}
size_t totalFrame() const { return mEndFrame - mStartFrame; }
long frameDuration() const { return mEndFrame - mStartFrame - 1; }
size_t totalFrame() const { return mEndFrame - mStartFrame + 1; }
long frameDuration() const { return mEndFrame - mStartFrame; }
float frameRate() const { return mFrameRate; }
size_t startFrame() const { return mStartFrame; }
size_t endFrame() const { return mEndFrame; }
Expand Down
4 changes: 2 additions & 2 deletions src/lottie/lottieparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ void LottieParserImpl::parseComposition()
} else if (0 == strcmp(key, "h")) {
comp->mSize.setHeight(GetInt());
} else if (0 == strcmp(key, "ip")) {
comp->mStartFrame = GetDouble();
comp->mStartFrame = std::lround(GetDouble());
} else if (0 == strcmp(key, "op")) {
comp->mEndFrame = GetDouble();
comp->mEndFrame = std::lround(GetDouble());
} else if (0 == strcmp(key, "fr")) {
comp->mFrameRate = GetDouble();
} else if (0 == strcmp(key, "assets")) {
Expand Down