Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: CGPathContainsPoint and "Open" Paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGPathContainsPoint and "Open" Paths



This is by design. You should close the path if you want to test "insideness".

haroon

On Nov 11, 2005, at 2:56 PM, Nick Nallick wrote:

In the following code fragment the variable "inside" is set to true as I would expect. However if I remove the call to CGPathCloseSubpath "inside" becomes false. This isn't what I would expect since the point is well within the path even if the path isn't closed. Is it fair to conclude that CGPathContainsPoint requires all subpaths to be closed? If so, is this by design or should I file a bug?

Thanks,
Nick


CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, nil, 0, 0); CGPathAddLineToPoint(path, nil, 100, 100); CGPathAddLineToPoint(path, nil, 200, 0); CGPathCloseSubpath(path); // this line is apparently required CGPoint testPt = {100, 50}; bool inside = CGPathContainsPoint(path, nil, testPt, false);

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >CGPathContainsPoint and "Open" Paths (From: Nick Nallick <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.