• 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
hit detection with NSBezierPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hit detection with NSBezierPath


  • Subject: hit detection with NSBezierPath
  • From: "Michael B. Johnson" <email@hidden>
  • Date: Thu, 01 Aug 2002 10:03:33 -0700

so I have a view that lets the viewer draw in, and I draw by building up NSBezierPaths with line segments of varying width (based on pressure). I now want to let the user drag a color on top of that path to change the color of the line after the fact. If my line is skinny, using NSBezierPath's containsPoint: works fine, but as the line thickness goes up, I realize that containsPoint: is more literal than I would like - it only has to do with the center line of the path; not the actual coverage of the path. In other words, if I have a line that goes from 0,0 to 10,10 with a thickness of 10, the point 1,2 is *not* considered to be on the path, while visually it most certainly is.

There are obviously several different ways I could go about solving this, but they're all more expensive than I'd like, and I'm certainly convinced that (a) this is the AppKit's job and (b) my way I come up with in a day is not the ultimate smart/fast way to do it.

So is there something I'm missing here, or should I be filing a feature request, or...?

constructive suggestions appreciated.


--> Michael B. Johnson, Ph.D. -- email@hidden
--> Studio Tools, Pixar Animation Studios
--> http://xenia.media.mit.edu/~wave
_______________________________________________
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.

  • Prev by Date: Re: -LoginHook & -LogoutHook
  • Next by Date: Mail.app and Proxy Servers: Cocoa Apps and Carbon APIs
  • Previous by thread: Re: -LoginHook & -LogoutHook
  • Next by thread: re: hit detection with NSBezierPath
  • Index(es):
    • Date
    • Thread