Hi Thomas,
thanks for your swift reply.
Is there a best practice for cases like this, or could/should I just
replace the interactors by another set
of DOM listeners?
The best practice is to stick to DOM Event listeners when you can.
In this case the only slightly tricky bit is that you need to make sure
that the canvas is fully covered by something (often a visiblity="hidden"
rect with pointer-events="fill" that you ensure covers anything the canvas
might show). Then you can register your listener on the root SVG and
receive all mouse move events in the canvas.
Following the list, I had already learned about that technique and
attempted to implement it. However, once the rectangle
was in place, it seemed that none of the "underlying" elements received
any events any longer.
I didn't know about the pointer-events-property, so maybe that's the
problems cause.
If it is not, I believe I could fix this by inserting the rectangle as
the first child of the root SVG element. Correct?
What's more, I've experimented with the pointer-events property for a
bit in the hopes that it could solve another, simpler problem with
interaction.
I have a set of two polygons that are defined as a symbol and referenced
troughout the document.
Each reference is defined as an <g>-group to which first the
<use>-reference and then a <text> is added.
Most of these references have the "fill" property set to a color, but
some remain at fill="none".
This second class of unfilled polygons is causing me trouble, since I
seem unable to get events from them, even though
I have (now) set pointer-events="visible" on the <use> element.
Listeners are registered on the group, but as far as I know, events on
contained elements are bubbled up to the container,
so an event triggered on the polygon should reach the group. Actual
behaviour, however, differs, with events only being registered
from the stroked perimeter or the inner text.
From the specification I take it that events should be triggered even
though the polygons are fill="none"d.
Does my description bring to your mind any obvious mistakes I could have
made?
Have a nice sunday
-Urs
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]