Skip to main content
Solved

I want to know the coordinates of the line node

  • September 9, 2024
  • 3 replies
  • 85 views

yoshio
  • New Participant
  • 14 replies

Hi all.

I want to get the upper left coordinate of a line shape using the Plugin API.
I_Need_Arrows_XY

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/とく (日本語も大歓迎です)

View original
This topic has been closed for replies.

3 replies

y_toku
Figmate
  • Community Support
  • 2545 replies
  • Answer
  • September 10, 2024

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/とく (日本語も大歓迎です)


yoshio
  • Author
  • New Participant
  • 14 replies
  • September 11, 2024

Thanks y_toku

I solved this problem by using “absoluteRenderBounds”.

(日本語も大歓迎です)

とても心強いです。今後ともよろしくお願いいたします。


y_toku
Figmate
  • Community Support
  • 2545 replies
  • September 11, 2024

Yoshio さん

解決できたとのご返信ありがとうございます!良かったです。
また何かありましたら、お気軽にForumご利用ください。

引き続きよろしくお願いいたします。

Toku


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings