add conditional check for the lottie expressions support - #68
Conversation
3db79eb to
73750a9
Compare
There was a problem hiding this comment.
🟡 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.hinto the sharedExample.h. - Adjust
PictureTransformexample behavior (scaling line commented out) and update itstvgexam::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.
73750a9 to
9930334
Compare
9930334 to
4df4d00
Compare
There was a problem hiding this comment.
🔵 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
There was a problem hiding this comment.
🟢 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
No description provided.