Coordinate conversions in CALayer
Coordinate conversions in CALayer
- Subject: Coordinate conversions in CALayer
- From: Graham Cox <email@hidden>
- Date: Tue, 22 Jan 2013 09:12:51 +1100
Hi all,
Recently I built an (experimental) app around CALayer and friends which implements a vector schematic editor.
I found that CALayer isn't, not too surprisingly, really a good base for vector graphics - CAShapeLayer is nice enough but there's nothing for text and I rapidly ran into problems when trying to zoom into my view when layer objects became too large and started hitting OpenGL limits. I also found that supporting printing and capture to PDF needs a fair bit of work. The ability to perform easy animations is nice but not really important for the application here.
So I'm looking into implementing a CALayer-like architecture but which just draws using Core Graphics functions in the normal manner. Fairly straightforward but I'm having a bit of difficulty with methods such as -convertRect:toLayer:
My question is, is there a way to directly convert coordinates between two unrelated layers in a tree, or are these methods implemented by recursion up to a common parent node and then back down to the target layer? If I had some hint of how this was done in the real CALayer architecture it would help me avoid wasting time trying various blind alleys.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden