Question

I have a CALayer with 9 sublayers, which occasionally flip vertically and I use CATransform3D to do so. Now, my problem is that, sometimes, I need to apply a transformation to the super layer of those 9 layers. When I do that, the position and transformation of the sublayers gets all screwed up. Is there a way to ignore the transform of the parent layer, so that it doesn't affect the sublayers?

Was it helpful?

Solution

The whole point of the layer tree is to inherit attributes like transforms. If you don't want certain layers to inherit from their parent, insert them as another layer's children.

You could also apply the inverse transform to the child layers, but that would be hackish, compute-intensive, and open the door to rounding errors.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top