On Apr 15, 2011, at 20:55, Roland King wrote:

> 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. 

That's not how I'd interpret the documentation. The description of (say) 
'CGPathAddCurveToPoint' says: "Appends a cubic Bézier curve to a mutable 
graphics path". The description of 'CGPathAddPath' says: "Appends a path to 
onto a mutable graphics path". That suggest they have the same semantics.

For this to work, of course, both paths would need to be open.

Are you seeing different behavior when you try it?

It's possible you may need to do a 'CGMoveToPoint' specifying the last point of 
the first piece before appending the second piece, but it's also possible that 
this will create an unwanted 0-length line segment, so you should test out the 
behavior.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to