• 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: Hamish Allan <email@hidden>
  • Date: Wed, 19 May 2004 22:35:12 +0100

Hi Steve,

Currently, as you know, an NSBezier won't let you add a line until you've added an initial point (I don't know about other curves, I haven't tried them). Relaxing this restriction (by assuming that the point from which the line is drawn is the final point in the path, i.e., paths with only line elements in them are implicitly closed) would have at least three positive outcomes:

1) It would be possible to append paths to create joined paths in the manner that I tried to do
2) Adding and removing elements in the manner that you describe could be performed without the consistency checking that they would currently have to undergo
3) If you're creating a path to describe the curve of a dataset, like I am, it's surely always easier just to iterate over every datapoint with 'lineToPoint' than to have to treat the zeroth element differently (with 'moveToPoint').

Can you (or anyone else) think of any negative outcomes, before I file a bug report myself?

Thanks,
Hamish

On May 19, 2004, at 21:08, Steve Sims wrote:

Having looked at the docs myself I too can't see a direct way to change the type of an individual path element. The way to do it would seem to be to create a new NSBezierPath by itterating through your source path one element at a time using elementAtIndex:associatedPoints:.

It's a shame that there aren't better facilities made available for editing the elements of an NSBezierPath. It would also be useful to be able to add elements at certain points within the path. The best way I can see to do that kind of thing right now is to maintain a separate array of path elements from which an NSBezierPath can be recreated. Alternately you could keep an array of path elements and bypass NSBezierPath entirely, making use of the CG calls instead.

Redesigning NSBezierPath to be a subclass of NSMutableArray would seem to be a sensible way to accomplish this. Maybe in Tiger... I've already filed a bug report suggesting this.

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


References: 
 >[firstPath appendBezierPath: [secondPath bezierPathByReversingPath]]; (From: Hamish Allan <email@hidden>)
 >Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]]; (From: Steve Sims <email@hidden>)
 >Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]]; (From: Hamish Allan <email@hidden>)
 >Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]]; (From: Steve Sims <email@hidden>)

  • Prev by Date: Default Mail/Web apps
  • Next by Date: Trap NSLogs
  • Previous by thread: Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
  • Next by thread: Re: [firstPath appendBezierPath: [secondPath bezierPathByReversingPath]];
  • Index(es):
    • Date
    • Thread