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

Fix bounds calculation for masked sublayers #205

Merged
merged 1 commit into from
Jun 7, 2017
Merged

Conversation

Pretz
Copy link
Contributor

@Pretz Pretz commented Apr 4, 2017

This fixes an issue where views added via addSublayer:toLayerNamed: would receive incorrect frames.

It looks like when the bounds calculation for LOTCustomChild was moved from LOTAnimationView to LOTCompositionLayer in #110, the reference layer for the bounds of the child layer didn't get updated correctly. This is visible in the sample transition animations included with lottie-ios-Example.

Additionally, this removes the mask layer from its superlayer, as CALayer.mask's docs say The layer you assign to this property must not have a superlayer. If it does, the behavior is undefined.

Before:

apr-04-2017 14-37-17

After:

apr-04-2017 14-35-50

@Pretz
Copy link
Contributor Author

Pretz commented Apr 5, 2017

Looks likely this will fix #198, although it's hard to be certain without a specific example.

@buba447 buba447 merged commit c02cc0c into airbnb:master Jun 7, 2017
NSGolova pushed a commit to clario-tech/lottie-ios that referenced this pull request Nov 19, 2020
Fix bounds calculation for masked sublayers
calda pushed a commit that referenced this pull request Dec 1, 2022
Fix bounds calculation for masked sublayers
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