I need to get the dimension on the screen of a <path> in a SVG from JavaScript.
I do not have any "transformation" or "scaling" (transform, scale) on my SVG.
The only thing changed is the viewBox, which will change the size of all the elements in the SVG.
I have been using myPath.getBBox(), the width returned stays the same even though I change my viewBox.
So I'm wondering what is the relation with this viewBox and size of a path. Maybe there is a function to compute the width?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…