سؤال

I was wondering if there is any way to find out if an NSPoint is inside an NSBezierPath. Like:

NSPointInRect(aPoint,aRect)

But with a BezierPath.

Thanks in advance, Ben

هل كانت مفيدة؟

المحلول

Yes. See this method:

containsPoint:

Returns a Boolean value indicating whether the receiver contains the specified point.

- (BOOL)containsPoint:(NSPoint)aPoint

Parameters aPoint The point to test against the path, specified in the path object's coordinate system.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top