I wants to know the coordinates of a SVG object (i.e ending x and y coordinates if starting x,y coordinates and height,widths are known to us) after rotation and scaling of that SVG object.
Is there any way to calculate Ending coordinates of the SVG objects after rotation ?
If anybody knows please help me to solve this problem.
BBox method is helpful to get your starting and end point after or before applying the shape or object.
You can select the object using d3 or jquery
if you are using d3 the select in this way
var rect = d3.select(selecteObject);
if jquery then
var rect = $(selecteObject);
var newx = rect.node().getBBox().x;
var newy = rect.node().getBBox().y;
var neww = rect.node().getBBox().width;
var newh = rect.node().getBBox().height;
var endCodinatex = newx + neww;
var endCodinatY = newy + newh;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With