[cairo] Hit test path area recipe

Jeff Muizelaar jeff at infidigm.net
Fri Nov 9 08:47:00 PST 2007


On Fri, Nov 09, 2007 at 06:15:12PM +0200, Donn wrote:
> > cairo provides cairo_in_stroke() and cairo_in_fill() for doing hit
> > testing.
> I had a quick look, pity I didn't find them earlier. I was looking in the path 
> section of the API... Seemed logical to me :)
> 
> Those funcs don't seem to be able to work on a stored path for testing later, 
> so ,my routine is still handy. It would be nice if one could:
> 
> someotherpath = cr.copy_path_flat()
> .
> <draw other stuff>
> .
> result = cr.cairo_in_fill(someotherpath)

Doesn't this work?

someotherpath = cr.copy_path_flat()
.
<draw other stuff>
.
cr.append_path(someotherpath)
result = cr.in_fill()

-Jeff


More information about the cairo mailing list