Re: No "pointer-events" property to make svg tag trigger events.

Hi Kevin,


> The issue is that sometimes it would be nice to
> have the svg trigger events directly without requiring a rectangle.  I ran
> into a particular situation where this was desirable.

Right. I ran into this issue several time also. This is addressed in
SVG Tiny 1.2 by the 'viewport-fill' - and related
'viewport-fill-opacity' - properties [1]. I haven't double checked if
pointer events were triggered in this case but, intuitively, I'd say
they should.


> One issue is that I
> must constantly resize and move the rectangle around as the svg canvas area
> changes size and the viewBox moves around.  In the end, the code must move
> and resize both the svg and a rect (in sync) to make it work right; this is
> not really the most desirable method.  However, in the end, I can always
> find a workaround to these issues.

Right again. I've done this by registering in several SVG events
(zoom, resize, scroll) and then apply an inverted matrix transform to
the canvas rectangle (obtained via 'getScreenCTM'). It works well
enough, although naturally introduces some processing overhead,
slightly noticeable in at least IE+ASV (recent Gecko and WebKit based
browsers tend to perform very well, BTW). ;-)


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVGTiny12/painting.html#viewport-fill-property

Received on Sunday, 19 December 2010 18:11:34 UTC