PathContainsPoint functionality incomplete
PathContainsPoint functionality incomplete
- Subject: PathContainsPoint functionality incomplete
- From: Kurt Bigler <email@hidden>
- Date: Sun, 17 Sep 2006 03:04:00 -0700
- Thread-topic: PathContainsPoint functionality incomplete
My view contains non-closed paths that are stroked (not filled). I want to
be able to detect mouse clicks within one of the stroked objects.
I see two conceivably relevant functions: CGContextPathContainsPoint and
CGPathContainsPoint.
I think I want to create a path and save it after using it for drawing. But
I want to save the stroked version of the path (i.e. as in
CGContextReplacePathWithStrokedPath).
Apparently there is no way to work with a stroked path except within a
graphics context, and CGContextPathContainsPoint permits a stroked drawing
mode to be specified whereas CGPathContainsPoint does not.
Yet the implication is that I need to use a graphics context in a
non-drawing situation. What is the appropriate way to do this? Do I use
the window's drawing context but not draw? I don't think I want to create
an off-screen bitmap context just so I can do some math on CGPaths.
Also, using a CGContext in this way seems to require re-stroking the path
for each ContainsPoint operation. If I really have to use a CGContext what
I think I'd want is to be able to call CGContextReplacePathWithStrokedPath
and then somehow save the resulting stroked path for later reuse for
ContainsPoint operations (ideally independent of the CGContext at that
point). I would expect to cache the resulting path in each graphics object
I create that uses stroked non-filled paths and requires click detection.
How are others accomlishing such things?
Thanks in advance for any pointers.
-Kurt Bigler
_______________________________________________
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