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

Round corners are not rendered correctly on path shape content. #2561

Open
RickAi opened this issue Oct 11, 2024 · 4 comments
Open

Round corners are not rendered correctly on path shape content. #2561

RickAi opened this issue Oct 11, 2024 · 4 comments

Comments

@RickAi
Copy link

RickAi commented Oct 11, 2024

Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.

If you don't use this template, your issue will be closed. Delete this text once completed.

Checklist

  1. My animation doesn't use any unsupported features. ✅
  2. I know what part of my animation doesn't work. ✅
  3. I have created a simplified version of my animation ✅
  4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn't work. ✅

Describe the bug
A clear and concise description of what the bug is.
Round corners are not rendered correctly on path shape content.

A very simple example is a path only with 3 vertices:
✅ lottie-web:
image
❌ lottie-android:
image

More open path example:
✅ lottie-web:
image
❌ lottie-android:
image

A closed path example with 4 vertices:

✅ lottie-web:
image
❌ lottie-android:
image

What version of Lottie did you test this on?
6.5.2

What version of Android did you test this on?
Android 12.0

Steps To Reproduce
Steps to reproduce the behavior:

  1. unzip the attachment .zip file: roundcorner_issue.zip
  2. render json files (closed, 3points or points.json) with lottie-android
@gpeal
Copy link
Collaborator

gpeal commented Oct 27, 2024

I just looked into this and there are two separate issues here.

  1. There are some issues with non-closed shapes that I need to spend more time to get right
  2. If there is a rounded corner animation but nothing else, the cached path would always get returned. That will be fixed with Fix rounded corner animations when the underlying shape doesn't animate #2567

gpeal added a commit that referenced this issue Oct 27, 2024
…te (#2567)

Previously, if there was a rounded corners animation but no animation on the shape, the shape would never be marked as dirty and would keep returning the cached value.

#2561
@alexzhirkevich
Copy link

@gpeal
Is there a reason why you don't utilize CornerPathEffect for rounding corners? I use it here and it works perfectly fine for all examples above.

@gpeal
Copy link
Collaborator

gpeal commented Oct 29, 2024

@gpeal Is there a reason why you don't utilize CornerPathEffect for rounding corners? I use it here and it works perfectly fine for all examples above.

I could look into it. In general, lottie-android has limited effect support but it's worth adding support for when possible!

@alexzhirkevich
Copy link

I mean you can add this PathEffect to Paint to implement rounded corners shape, instead of manual curves modification that you do here. Similar to DashPathEffect that you use for dashed strokes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants