-
-
Notifications
You must be signed in to change notification settings - Fork 133
lottie: add lineTo support in round corner alg #3556
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
base: main
Are you sure you want to change the base?
Conversation
So far, there hasn't been a case where this support was necessary, but it will be once chaining is added- when the LottieRoundnessModifier::modifyPath() is called by a previous modifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for handling LineTo commands when applying round corner modifications in Lottie animations, paving the way for future chaining functionality.
- Added conditionals to process LineTo commands by invoking the round corner logic.
- Updated the main switch to include new branches for LineTo command handling with different index arithmetic.
Comments suppressed due to low confidence (1)
src/loaders/lottie/tvgLottieModifier.cpp:234
- [nitpick] It would be beneficial to add inline documentation explaining how _colinear and the subsequent index arithmetic ensure the correct points are used for rounding, as the offset differences could be confusing at first glance.
if (inCmds[iCmds + 1] == PathCommand::CubicTo && _colinear(inPts + iPts)) {
iPts += 3; | ||
break; | ||
} else if (inCmds[iCmds + 1] == PathCommand::Close) { | ||
} | ||
if (inCmds[iCmds + 1] == PathCommand::LineTo) { | ||
_roundCorner(path.cmds, path.pts, prev, curr, inPts[iPts + 3], r); | ||
iPts += 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The index offset used here (iPts + 3) differs from the one used in the LineTo case (iPts + 1). Consider adding comments to document the rationale behind these differing offsets to improve maintainability.
Copilot uses AI. Check for mistakes.
@mgrudzinska do we have any test sample? |
9b6c8bc
to
a6ffb7a
Compare
as described here, for now not possible to test. only together with modifiers chaining |
7ceb794
to
43923a5
Compare
So far, there hasn't been a case where this support was necessary, but it will be once chaining is added- when the LottieRoundnessModifier::modifyPath() is called by a previous modifier.