2 ms·
You could use <g> tags for this, e.g. <svg> <g id="z-order-0"></g> <g id="z-order-1"></g> <g id="z-order-2"></g> </g> Then you can change the z-order by
by paulgb 8y ago
You could use <g> tags for this, e.g.
<svg>
<g id="z-order-0"></g>
<g id="z-order-1"></g>
<g id="z-order-2"></g>
</g>
Then you can change the z-order by moving the element to the appropriate group. Elements are rendered in the order of an inorder traversal which is why this works.
- wwweston 8y agoI like this -- I'm sure there's some annoying corner cases, but at first glance I think it covers most of the use cases I've worried about. Thanks!