Re: NSBezierPath bugs? (Contains point and fill)
Re: NSBezierPath bugs? (Contains point and fill)
- Subject: Re: NSBezierPath bugs? (Contains point and fill)
- From: Andy Armstrong <email@hidden>
- Date: Wed, 12 Oct 2005 12:51:06 +0100
On 12 Oct 2005, at 08:33, Scott Harper wrote:
First, when I iterate through all the points in the rect gotten
from the path's -bounds method and check them to see if the pixel
is within the path -- [path containsPoint:NSMakePoint(x, y)] -- I
will sometimes get several pixels WITHIN the path that do not
register as BEING contained by that path. It's generally several
points inside horizontally, and it often occurs a couple of times
along a given edge. It never happens with columns of pixels,
either. I don't know what could be causing this, though I'm pretty
sure it's not MY fault.
I can't answer your question but I'm curious about something...
You're iterating through /all/ the pixels in the rectangle checking
whether each is inside the polygon? So for a 100x100 bounding
rectangle you're doing 10,000 tests against the polygon? That seems
incredibly inefficient - does it have to be done that way?
I'm not /just/ concerned about efficiency - chances are if you do it
in a more efficient way the bug you're seeing will disappear too :)
--
Andy Armstrong, hexten.net
_______________________________________________
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