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

Add rounded corner support to Core Animation rendering engine #1796

Merged
merged 3 commits into from
Nov 3, 2022

Conversation

calda
Copy link
Member

@calda calda commented Nov 2, 2022

This PR adds rounded corner support to the Core Animation rendering engine, following #1795 which added this support for the Main Thread rendering engine

@calda
Copy link
Member Author

calda commented Nov 2, 2022

fyi @johnny-duo

func roundCorners(radius: CGFloat) -> BezierPath {
guard radius > 0 else {
Copy link
Member Author

@calda calda Nov 2, 2022

Choose a reason for hiding this comment

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

I had to remove this, because it caused artifacts when Core Animation tried to interpolate between a path with roundedCorners(radius: 0) to any other value. Even though path and path.roundedCorners(radius: 0) are visually identical, the individual points in the bezier curve are different.

Before After
Simulator Screen Shot - iPhone 12 Pro Max - 2022-11-02 at 16 01 44 Simulator Screen Shot - iPhone 12 Pro Max - 2022-11-02 at 16 01 04

I added back the equivalent logic to the call site from the Main Thread rendering engine, which doesn't have this issue

@calda calda force-pushed the cal--core-animation-rounded-corners branch from b258fb6 to 1e4036f Compare November 2, 2022 23:41
@calda calda merged commit be849b9 into master Nov 3, 2022
@calda calda deleted the cal--core-animation-rounded-corners branch November 3, 2022 16:25
iago849 pushed a commit to atteamapps/lottie-ios that referenced this pull request Feb 8, 2024
MoroziOS pushed a commit to MoroziOS/tmg-lottie-ios that referenced this pull request May 22, 2024
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