[cairo] Hit detect surface?
Carl Worth
cworth at cworth.org
Wed Mar 1 12:04:42 PST 2006
On Wed, 01 Mar 2006 14:03:43 -0500, wrote:
>
> Hmm, it's not necessary to do a full tesselation to implement those
> functions -- for fills and strokes with round caps+joins, it's as
> simple as flattening the path and then:
Correct. I was describing the current implementation, and it could
definitely be optimized a bunch. But the point is that there are
bigger savings to be had at a higher-level first.
> However, to be really useful for user interface picking, you'd want
> a tolerance radius, too. I suppose that could be approximated by
> testing against an appropriately-sized square rather than a point.
In the past, an interface proposed for this was one that returned the
distance from a given point to the nearest point of the stroke or
fill.
In fact, a patch to implement that has been sitting in my INBOX since
February of last year (*blush*). I've just committed that now and
pushed it to a new branch of my personal tree. You can fetch that into
an existing tree with:
git fetch git:///git.cairographics.org/~cworth/cairo distance-to-path
The patch has bit-rotted a little bit, and I might suggest a couple of
API changes in it. I'll commit enough changes to make it compile, then
follow up the list to the original proposal.
-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060301/092882f7/attachment.pgp
More information about the cairo
mailing list