admin管理员组文章数量:1435859
I'm trying to get the path length for the stroke of a SVG text element and I'm getting a path.getTotalLength is not a function
error in my console. When I look up getTotalLength
, I see that it's been depreciated? It looks like it has something to do with the shift from SVG1 to SVG2? Is this correct?
I'm trying to get the path length for the stroke of a SVG text element and I'm getting a path.getTotalLength is not a function
error in my console. When I look up getTotalLength
, I see that it's been depreciated? It looks like it has something to do with the shift from SVG1 to SVG2? Is this correct?
- I don't think it never did have this method... – Kaiido Commented Apr 4, 2017 at 6:01
- What do you think the total length of text is? How would you calculate it? – Robert Longson Commented Apr 4, 2017 at 7:13
1 Answer
Reset to default 5It has not been deprecated. In SVG 1.1, getTotalLength()
is only available on the <path>
element.
In SVG 2, which browsers are still in the process of implementing (so you can't rely on it yet), getTotalLength()
is available on all shape elements, but not including text elements.
本文标签: javascriptDoes pathgetTotalLength work for text svgStack Overflow
版权声明:本文标题:javascript - Does path.getTotalLength work for text svg? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745670726a2669552.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论