svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

set leading separately for tspan #1198

Closed pyuyu closed 2 years ago

pyuyu commented 3 years ago

I want to set a separate leading for each tspan in the text, but only the leading of the text takes effect, so I try to set dy and x instead of newLine(). But after maintaining dy and x by myself, when I drag the text element, the x of tspan does not change (when using newLine(), while rebuild, x of tspan will be updated with the x of text). Is there any way to set leading separately for tspan?

Fuzzyma commented 3 years ago

No unfortunetaly there is not. You have to roll your own solution. You can bind to the dragmove event and update what you need to update accordingly