by rektide · 3y ago · 0 comments
I'd be very interested to get more discussion on this specific issue, of handling mouse events well in SVG.
The particular example felt contrived, in that I might just apply a class HasPointerEvents to every element and change the pointer events off for everyone except the drag & the dropped element. But I suspect there may be some other real mouse handling topics in SVG that really are interesting & challenging, & would love some discussion on that. Kind of iwld that the internet doesn't have a ton of obvious forums to go hash out tech topics like this... Post a random question/challenge to stackoverflow & cross your fingers.
There are some more interesting but less easy to explain to a broad audience examples.
One is having “nearest the pointer” hovering logic rather than rectangles or circles overlaying each other.
Another is hovering line segments and the projecting the nearest hovered point onto the line. That was approximated with SVGs before and was just kind of a bug.
Another example is allowing some “wiggle room” for touching elements without having to render SVGs multiple times with transparent elements and stuff like that.