[Cairo] mouse pointer and cairo
cworth at east.isi.edu
Tue Oct 28 18:15:35 PST 2003
On Oct 22, Thomas Hunger wrote:
> Sorry, I removed the tarball, I appended the diff to this mail,
Tom, thanks for contributing this!
> but the api should not stay like in the patch.
Yes, as we talked about earlier, cairo_in_stroke and cairo_in_fill can
just directly return the flag rather than storing it and requiring
another call to check it.
> The _cairo_in_traps function is where the action happens (simple
> testing for half-planes).
This is very encouraging. The good news is how little code is needed
to implement this.
The only other thing that needs to be fixed here is that all of the
comparison should happen in fixed point rather than floating point.
And for doing the half-plane tests in floating-point, there is some
code in cairo_slope.c to help.
Given a point P and a half-plane formed by the line segment AB, you
can _cairo_slope_init the two slopes AP, AB, then call
_cairo_slope_compare to determine where the point falls.
More information about the cairo