• 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: Drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing


  • Subject: Re: Drawing
  • From: "Dennis C. De Mars" <email@hidden>
  • Date: Sat, 16 Jun 2001 10:59:17 -0700

on 6/15/01 6:53 AM, Joshua D. Orr at email@hidden wrote:

> I have lots points, some of them have lines connected between them, some of
> the lines/points make polygons that need to be filled in. I need to make it
> so that the user can drag the points around individually. I was thinking of
> using NSBezierPath, but when I was reading about it, it said that it's
> subpaths can't be change individually, only as a group, and you will need to
> make separate NSBezierPaths. But this seems kind of a lot of overhead?
>
> Any of you have any suggestions on what I can use?

In the documentation of NSBezierPath, there is a group of methods listed
under the heading "Accessing elements of a path." These include methods
called "- elementTypeAtIndex:associatedPoints:" and "-
setAssociatedPoints:atIndex:" It looks to me as if you _could_ change
individual points in an existing NSBezierPath with these, although I haven't
tried this myself. Where did you read that the subpaths can't be changed?

Actually, if I was doing what you describe, I'd probably just store the
points myself and recreate the NSBezierPath whenever a point is changed.
When you say "need to make separate NSBezierPaths" I don't know if you mean
have one NSBezierPath and replace it with a new one whenever one of the path
points changes, or have a bunch of NSBezierPaths, one for each segment. I
would pick the former solution myself. I guess an advantage of the latter is
if you change a point you only have to redraw that segment, whereas if you
only have one NSBezierPath, the entire path has to be redrawn when you
change just one segment.

- Dennis D.


References: 
 >Drawing (From: "Joshua D. Orr" <email@hidden>)

  • Prev by Date: Re: Cocoa/EOF for non-enterprise apps Re: proof of cocoa
  • Next by Date: How to submit Mac OS X bugreports?
  • Previous by thread: Drawing
  • Next by thread: WWDC Dev Tools / Software update
  • Index(es):
    • Date
    • Thread