News for hackers. Stuff that matters.
Re:From SVG to Canvas – A new way of building interactions by rektide on Wednesday June 07, 2023 @11:25AM (#36228041)
Super late to this but they mention element overlap in SVG making thinks like drag & drop hard. That's their "interactivity" gripe, and the one that for me carried the most weight.

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.

Re:From SVG to Canvas – A new way of building interactions by hicksyfern on Wednesday June 07, 2023 @02:23PM (#36231111)
Author here. The example given is slightly contrived. A more realistic example involves large polygons that you zoom “inside” or locked elements overlaying active ones. But I had to try to give an example without a ton of context.

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.

Re:From SVG to Canvas – A new way of building interactions by rektide on Friday June 09, 2023 @02:15AM (#36253971)
Circling back just to say this was really fun & interesting stuff. Appreciate you responding with these cases!