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

Support combining shapes with different keyframe timings into the same CAShapeLayer #1699

Merged
merged 4 commits into from
Aug 4, 2022

Conversation

calda
Copy link
Member

@calda calda commented Aug 4, 2022

This PR adds support for combining shapes with different keyframe timings into the same CALayer.

We have to render all shapes in the same CAShapeLayer, or their fills may render incorrectly in places where the shapes overlap. We previously only did this when all of the shapes shared the exact same keyframe timing values.

In cases where the shapes have different keyframe timing values, we now combine them by manually interpolating the paths at each frame. This is similar to how we support path trims as of #1612.

Before After
Simulator Screen Shot - iPhone 12 Pro Max - 2022-08-04 at 11 03 38 Simulator Screen Shot - iPhone 12 Pro Max - 2022-08-04 at 11 03 04

Copy link
Collaborator

@erichoracek erichoracek left a comment

Choose a reason for hiding this comment

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

LGTM! Just one suggestion

@calda calda enabled auto-merge (squash) August 4, 2022 20:29
@calda calda force-pushed the cal--improved-combined-shapes branch from a8ceb2a to 0bd6d3c Compare August 4, 2022 20:33
@calda calda merged commit f2914c2 into master Aug 4, 2022
@calda calda deleted the cal--improved-combined-shapes branch August 4, 2022 20:52
calda added a commit that referenced this pull request Nov 28, 2022
calda added a commit that referenced this pull request Dec 1, 2022
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.

None yet

2 participants