• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Appending CGPath to CGPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appending CGPath to CGPath


  • Subject: Re: Appending CGPath to CGPath
  • From: Roland King <email@hidden>
  • Date: Sat, 16 Apr 2011 14:45:56 +0800

On 16-Apr-2011, at 12:17 PM, Quincey Morris wrote:

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

Yeah I tried it, doesn't seem to work. The end of the documentation for CGPathAddPath says this " After the call completes, the start point and current point of the path are those of the last subpath in path2.". The fact it says 'start' and 'end' means to me that it's started a new subpath and that's what it seems to me to be doing. I agree CGPathAddCurveToPoint and CGPathAddArc do draw a line to the point first, so the names are similar, but the semantics appear not to be.

_______________________________________________

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

References: 
 >Appending CGPath to CGPath (From: Roland King <email@hidden>)
 >Re: Appending CGPath to CGPath (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Appending CGPath to CGPath
  • Next by Date: Re: Appending CGPath to CGPath
  • Previous by thread: Re: Appending CGPath to CGPath
  • Next by thread: Re: Appending CGPath to CGPath
  • Index(es):
    • Date
    • Thread