mgraphics in_fill and svg

Jul 11, 2012 at 10:23pm

mgraphics in_fill and svg

I’m trying to use in_fill to detect mouseover and hover events on a rendered SVG graphic. is it possible?
I’m modifying the UseSVG patch from Darwin to try it out, and no luck with:
with (mgraphics) {
// draw the center
save();
translate(.0, .45);
mgraphics.svg_render(“ring.svg”);
var ovah = mgraphics.in_fill(loc);
post(“nover”,ovah);
restore()
…etc…
}
I always get 0 for the “ovah”. Is there a way I can do this?

#35945
Jul 12, 2012 at 6:19pm

Hi Peter,

I believe in_fill only works for the current path. To do what you want to do, you would probably have to get the size of the svg as well as the location of it, then compare it to the mouse’s current position.

-Ben

#123133

You must be logged in to reply to this topic.