How to set anchor point for resizing

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()?

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.