W3C home > Mailing lists > Public > www-svg@w3.org > December 2010

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

From: Helder Magalh„es <helder.magalhaes@gmail.com>
Date: Sun, 19 Dec 2010 18:09:44 +0000
Message-ID: <AANLkTimyTwMNntGAJ_NSPcYouoGv3ubtQXD3e5Gs+tOC@mail.gmail.com>
To: Kevin Ar18 <kevinar18@hotmail.com>
Cc: a.neumann@carto.net, public-fx@w3.org, www-svg@w3.org
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,

[1] http://www.w3.org/TR/SVGTiny12/painting.html#viewport-fill-property
Received on Sunday, 19 December 2010 18:11:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:23 UTC