Skip to content

add conditional check for the lottie expressions support - #68

Merged
hermet merged 1 commit into
mainfrom
hermet/lottie
Sep 1, 2026
Merged

add conditional check for the lottie expressions support#68
hermet merged 1 commit into
mainfrom
hermet/lottie

Conversation

@hermet

@hermet hermet commented Sep 1, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Example.h now unconditionally includes the Lottie header, which can break non-Lottie builds even when the build system skips compiling Lottie examples.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the ThorVG example set to better handle builds where Lottie expressions are unavailable, primarily by adding runtime guards in the expressions-dependent examples and refactoring header includes.

Changes:

  • Add runtime tvg::LottieAnimation::expressions() checks to skip running expressions-dependent Lottie examples when unsupported.
  • Refactor Lottie header inclusion by moving thorvg_lottie.h into the shared Example.h.
  • Adjust PictureTransform example behavior (scaling line commented out) and update its tvgexam::main(...) invocation parameters.
File summaries
File Description
src/PictureTransform.cpp Updates example runtime behavior and tvgexam::main(...) arguments.
src/LottieTweening.cpp Removes direct Lottie header include (now relies on Example.h).
src/LottieSlot.cpp Adds expressions support guard before running the example; removes direct Lottie header include.
src/LottieInteraction.cpp Adds expressions support guard before running the example; removes direct Lottie and math header includes.
src/LottieExpressions.cpp Adds expressions support guard before running the example.
src/Example.h Adds shared inclusion of thorvg_lottie.h for examples.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Example.h
Comment thread src/PictureTransform.cpp
Copilot AI review requested due to automatic review settings September 1, 2026 03:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Example.h now unconditionally includes the Lottie header, which can break compilation of non-Lottie examples when Lottie headers are not installed.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is low-risk and behaviorally scoped to example startup, with only a minor best-practice improvement suggested regarding explicit <cmath> inclusion.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/LottieInteraction.cpp
@hermet
hermet merged commit 3a1af7f into main Sep 1, 2026
3 checks passed
@hermet
hermet deleted the hermet/lottie branch September 1, 2026 04:01
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

Successfully merging this pull request may close these issues.

2 participants