Skip to main content
Solved

How to set anchor point for resizing

  • July 7, 2023
  • 1 reply
  • 3272 views

In my plugin, when I select some layers, I want them to always resize with respect to its top left or right corner like so:

However, it seems to always resize with respect to its bottom left corner for some reason:

Is there a way to specify an anchor point when i’m resizing a node aka when calling node.resize()?

Best answer by Gleb

This happens because your node is flipped/rotated.

You can’t set an anchor point but you can move the object to desired coordinates. All operations are done in relation to top left corner of the object.

This topic has been closed for replies.

1 reply

Gleb
  • Power Member
  • 4716 replies
  • Answer
  • July 7, 2023

This happens because your node is flipped/rotated.

You can’t set an anchor point but you can move the object to desired coordinates. All operations are done in relation to top left corner of the object.