Appending CGPath to CGPath
Appending CGPath to CGPath
- Subject: Appending CGPath to CGPath
- From: Roland King <email@hidden>
- Date: Sat, 16 Apr 2011 11:55:42 +0800
I have a CGPath which represents a small (but somewhat complicated) shape and I want to append a number of them together, connected with straight lines, to form a complete closed shape which I then want to use as a clip region. I thought that CGPathAddPath would do what I wanted as I can easily give it an affine transform matrix to move and rotate the template path and add it several times, however if I understand the documentation correctly, that adds the path as a new subpath, not connecting it up. As I want to use the final path as a clip region that's not going to work, I need one continuous path.
Is there a way to append two CGPaths together such that they really connect up to be one path? I can think of a way to do this with CGPathApply but it seems a bit hokey.
The motivation is that the small, complicated, oft-repeated path is pretty slow to draw, it has a number of connected arcs and I'm drawing several thousand of them when all I really need to do is draw it once, and then add it translated and rotated, over and over again and I can construct the transformation matrices very quickly. And yes that is measured performance, not premature optimization.
_______________________________________________
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