views:

18

answers:

0

My app relies heavily on Core Animation; the main view contains dozens of CALayers. In order to facilitate zooming in/out, I have a master layer which contains all layers that I wish to be 'zoomable'. When I zoom, simply modify the sublayerTransform of the master layer.

This works fine, however I would like the actual content rendered by some of my sublayers to remain the same size regardless of zooming. To be clear, I want these sublayers to still be positioned the same way they are now (their position is relative to their superlayer's transform), but what they render at that position should always be the same size (100% zoom level).

I think think this may be as easy as modifying the transform property of these sublayers to simply invert the scaling done by the transformation matrices of their superlayers, but is this the most effective way to do this? Or is there an easier way?

Also, if modifying the transform property is the best way to go about this, how do I calculate the appropriate transformation matrix which effectively nullifies the effects of the superlayer's transformation matrix?