How to rotate a node in a plugin and have the x and y position update automatically

When I rotate an object in Figma, i.e., set the rotation to X degrees, the X and Y position of the object update.

When I rotate an object in a plugin, by setting its rotation to a set value, the position values remain unchanged. Is there a way to rotate an object inside of a plugin, such that the position of that node is automatically updated like it is in the UI?

1 Like

Having the same issue. @Daniel_A_Castro_Chin did you figure this out? Thanks!

Hey Christian!

Yeah, basically I had to implement the rotation myself and set the relative transform accordingly. Here’s an example of someone doing this on Github: figma plugin to rotate selection around the center of itself. · GitHub.