Suppose this snippet code with svg.js
var g1 = draw.group();
var g2 = g1.group();
g2.move(100,100);
var g3 = g2.group();
g3.rect(200,200);
Now, how i can get the absolute position of this rect?
Thanks for any help
You can use the rbox function, which takes the translations into account.
Here is an example:
var draw = SVG('paper');
var g1 = draw.group();
var g2 = g1.group();
g2.move(100,100);
var g3 = g2.group();
var rect = g3.rect(200,200);
console.log(rect.rbox());
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