Jeff Rafter wrote:
>> Is there a way to test to see if a mouse position is within a shape?
>> 
>> If one uses getBBox() on a triangle, for example, the results are not 
>> very useful if one wants to know if the mouse is really within the 
>> triangle.
> 
> Another approach would be to track that information using events. For 
> example setup a mouseover event and a mouseout event to determine if the 
> mouse is in fact over the polygon. If necessary, store the information 
> in a global var.

Yes, it makes sense, let the viewer do the work. And it works for all 
SVG primitive shapes.

Algorithmic way is still useful, eg. to test if a point (center of 
circle or corners of rectangle for example) is inside a path.

And mouse events can be hard to track if shapes are overlaid, unless you 
cascade events.

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  For servers mangling my From and Reply-To fields,
--  please send private answers to PhiLho(a)GMX.net
--  --  --  --  --  --  --  --  --  --  --  --  --  --


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to