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

Re: NSBezierPath containsPoint?


  • Subject: Re: NSBezierPath containsPoint?
  • From: David Phillip Oster <email@hidden>
  • Date: Thu, 20 Oct 2005 21:17:17 -0700

At 4:36 PM -0700 10/20/05, "Brian O'Brien" <email@hidden> wrote:
Hi I've been drawing shapes with NSBezierPath and have been been using containsPoint
to determine if the mouse is inside a shape.


This seems to work well for polygons, rectangles and ovals but doesn't work for
a straight line.


How can i tell if the mouse is on top of a line?

The classic algorithm is: start with a 1x1 drawing context cleared to transparent, offset by the mouse coordinates, draw your bezier curve into it. If it is not transparent afterward, then the mouse is on the curve.


That is how MacDraw did it 20 years ago.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Authenticate a user
  • Next by Date: Re: NSBezierPath containsPoint?
  • Previous by thread: Re: NSBezierPath containsPoint?
  • Next by thread: Re: NSBezierPath containsPoint?
  • Index(es):
    • Date
    • Thread