Hi all.
I want to get the upper left coordinate of a line shape using the Plugin API.
Hi all.
I want to get the upper left coordinate of a line shape using the Plugin API.
Best answer by y_toku
Hi there,
Thanks for the post! As I checked with our internal team, it seems you can use absoluteBoundingBox
(docs) – the x,y fields should be that top-left coordinates. If that doesn’t work, could you try absoluteRenderBounds
(docs)?
absoluteRenderBounds
is going to account for that stroke geometry that goes outside the absoluteBoundingBox
(like that big circle on the starting point), but both properties are going to give you coordinates in canvas space.
On the other hand, the coordinates in the properties panel are relative to the node’s parent, so you will need to do some math to convert the canvas space coordinates to relative coordinates.
I hope this helps and please let us know how that works!
Thanks,
Toku/とく (日本語も大歓迎です)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.