[cairo] DrawingArea events - cross posted

John Ellson john.ellson at comcast.net
Fri Nov 9 05:15:08 PST 2007


Donn wrote:
>> What would be really nice is yet another (!) type of cairo surface, a
>> "hit detect" surface. 
>>     
> While that sounds great -- I would settle for even a pseudo-code algorithm for 
> how to detect x y within a path. I have been searching and coming up blank 
> really. 
>
> I have some ideas, but they involve sorting the xy of nodes and then stepping 
> around and testing bounds -- that's still fuzzy. I'm not well, so not 
> thinking clearly. Or converting a path to an image and testing for a colour. 
>
> Any hints ;)
>   

Tk's canvas has some wonderfully clear code that you can study for 
techniques.  (http://www.tcl.tk/)

John


More information about the cairo mailing list