diff --git a/lottie-ios/Classes/AnimatableLayers/LOTCompositionLayer.m b/lottie-ios/Classes/AnimatableLayers/LOTCompositionLayer.m index ecc905465d..6e2909ddd0 100644 --- a/lottie-ios/Classes/AnimatableLayers/LOTCompositionLayer.m +++ b/lottie-ios/Classes/AnimatableLayers/LOTCompositionLayer.m @@ -115,7 +115,7 @@ child.childView.frame = child.layer.bounds; break; case LOTConstraintTypeAlignToBounds: { - CGRect selfBounds = self.frame; + CGRect selfBounds = self.bounds; CGRect convertedBounds = [child.childView.layer.superlayer convertRect:selfBounds fromLayer:self]; child.childView.layer.frame = convertedBounds; } break; @@ -141,7 +141,8 @@ } else { newChild.layer = layerObject; [layerObject.superlayer insertSublayer:view.layer above:layerObject]; - + + [layerObject removeFromSuperlayer]; view.layer.mask = layerObject; }