I'm drawing text within a CGPath
, in order to do hit-testing on the text, I'm using CTFrameGetLineOrigins
. Here's what the documentation says:
Each CGPoint is the origin of the corresponding line in the array of lines returned by CTFrameGetLines, relative to the origin of the frame's path.
How would I go about finding the origin of the frame's path? Examples I've found all save the origin of the path when the path is initially created. I have two problems with this:
- The creation of my path is quite distant from the place where I'm doing the hit testing. I would need to make sure that I'm passing around a
CGPoint
in addition to theCGPath
. Ugly, but not insurmountable. - What is the origin for a shape that isn't rectangular? What is the origin of a circular CGPath?