Closed csae7255 closed 2 years ago
I solved the problem.
Instead of using text.add(tspan) one has to use text.put(tspan). This also fixes the problem with newLines: text.put(tspan).newLine() works as expected.
The reason why put is working, is because put returns the element you pass to it. Since you have to call newLine on the tspan and not the text, you have to make sure that your newLine call is actually on the tspan (with put()) and not on the text (with add())
When creating a tspan via new SVG.Tspan().text('...') there are problems adding it to a text:
https://jsfiddle.net/csae7255/2jz30hbk/3/