'svg element attribute y is not getBBox().y
Following is my code, attr y is translate y not "y in svg", I expect find attr svgY to set "y in svg", how to do?
var it: SVGTextElement
ReactDOM.render(<svg>
<text ref={e => it = e} y={10}>pr</text>
</svg>, document.querySelector("#root"))
var by = it.getBBox().y
console.log(`by:${by}`) // by:-4.34375
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|