[Cairo] mouse pointer and cairo

Owen Taylor otaylor at redhat.com
Mon Oct 13 08:20:56 PDT 2003


On Tue, 2002-10-29 at 12:54, Thomas Hunger wrote:
> > Can you explain you explain a bit more about what you are trying to do
> > here? By "mouse pointer", do you mean the single current point, or the
> > visual representation on screen (a Cursor in X terms)?
> 
> I needed to know if the hotspot (the coordinates given by the notion notify 
> event) of the mouse pointer, was inside a stroke (a stroke that was visible 
> on the screen, so in screen device coordinates). 
> 
> Intersections between different shapes could need the exposure of 
> cairo_path_t, as  Carl wrote, or the user would have to do intersections 
> between two cairo_t's with something like this:
> cairo_intersect_stroke_stroke (cairo_t, cairo_t)
> cairo_intersect_stroke_fill (cairo_t, cairo_t)
> cairo_intersect_fill_fill (cairo_t, cairo_t)

Exposing the path type would clearly be the right way to do it. 

> Intersection between different cairo objects 
> > Determining whether a point is inside a path seems likely a reasonable
> > analytic operation for Cairo to have; if you wanted to intersect a
> do you mean there is already a function for it?

What I meant is that point-in-path is:

 A) Well defined
 B) Probably useful occasionally
 C) Not all that hard to implement

Analytically intersecting two paths, on the other hand, is a really
tricky operation to implement.

Regards,
						Owen






More information about the cairo mailing list