+
Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgrudzinska
Copy link
Collaborator

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.

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.
@mgrudzinska mgrudzinska self-assigned this Jun 18, 2025
@mgrudzinska mgrudzinska added enhancement Improve features lottie Lottie animation labels Jun 18, 2025
@hermet hermet requested a review from Copilot June 19, 2025 02:05
Copy link

@Copilot Copilot AI left a 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)) {

Comment on lines 209 to +214
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;
Copy link
Preview

Copilot AI Jun 19, 2025

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.

@hermet
Copy link
Member

hermet commented Jun 20, 2025

@mgrudzinska do we have any test sample?

@hermet hermet force-pushed the main branch 3 times, most recently from 9b6c8bc to a6ffb7a Compare June 23, 2025 07:12
@mgrudzinska
Copy link
Collaborator Author

@mgrudzinska do we have any test sample?

as described here, for now not possible to test. only together with modifiers chaining

@hermet hermet force-pushed the main branch 5 times, most recently from 7ceb794 to 43923a5 Compare June 25, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve features lottie Lottie animation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载