You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varcanvas=SVG().addTo('#canvas').size('100%','100%')// create your example hereconstgroup1=canvas.defs().group().id("A2");group1.circle(200).translate(10,10).fill("red");constgroup2=canvas.defs().group().id("A20");group2.circle(200).translate(50,50).fill("green");constgroup3=canvas.defs().group().id("A200");group3.circle(200).translate(90,90).fill("blue");constgot1=canvas.findOne("#A2");canvas.use(got1);constgot2=canvas.findOne("#A20");canvas.use(got2);constgot3=canvas.findOne("#A200");canvas.use(got3);
Explanation
If you look at the resulting SVG, you'll see that the <use> tag for #A20 got converted into <use xlink:href="#aa2200"></use>, which of course doesn't exist in defs and so the green circle doesn't display.
The text was updated successfully, but these errors were encountered:
.use() calls .attr('href', ..., and it's a sanity check in attr() that expands any hex-color-like value to the full hex color, thus an invalid href id.
Bug report
use()
is apparently converting IDs that it thinks are shortened hexadecimal colour strings.Fiddle
https://jsfiddle.net/krtwhuLb/3/
Explanation
If you look at the resulting SVG, you'll see that the
<use>
tag for#A20
got converted into<use xlink:href="#aa2200"></use>
, which of course doesn't exist indefs
and so the green circle doesn't display.The text was updated successfully, but these errors were encountered: