Re: NSBezierPath containsPoint?
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