• 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: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];


  • Subject: Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
  • From: Robert Clair <email@hidden>
  • Date: Fri, 21 May 2004 08:30:56 -0400

I have found that if I try lineToPoint: on an NSBezierPath without having first called moveToPoint: I get a runtime error. How do I obtain these open polylines?



A line segment has two points, one for each end, a curve segment (like all good cubic
Beziers) requires four: two end control points and two interior control points.
NSBezierPath (and PostScript) work on the concept of adding segments to a path. For both
types of segment the first point is implicitly the "current point", most often the end point of the previous
segment. But you have to start the process somewhere, that is what moveTo is for. If you
try and add a segment without establishing a current point with a moveTo, the beginning point of the
the segment is undefined and you will get, as you note, an error.

An open polyline of N segments has N+1 points and the path is created by

moveTo: point0, lineTo: point1, lineTo: point2, ..., lineTo: pointN

I'm sorry, but I am not grasping the cause of your allergy to moveTo.


......Bob
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
      • From: Hamish Allan <email@hidden>
References: 
 >Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]]; (From: Hamish Allan <email@hidden>)

  • Prev by Date: Re: NSMakePoint and such - what about memory allocation?
  • Next by Date: Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
  • Previous by thread: Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
  • Next by thread: Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
  • Index(es):
    • Date
    • Thread