Jump to content
Search Community

How to scale selected object without changing its current position?

Bharat Patel test
Moderator Tag

Recommended Posts

Hi,

 

I am using 'selectionScaleX' & 'selectionScaleY' property to scale selected image.

 



_transformManager.selectionScaleX = 0.5
_transformManager.selectionScaleY = 0.5


 

However it change the image x and y position. 

 

Is is possible to scale selected image object without changing image position?

 

Thank You

Regards,

 

Bharat

Link to comment
Share on other sites

By its very nature, scaling must change the selected object's x/y position unless its registration point happens to line up directly on the overall selection's origin. If you'd like things to scale from the selection's center, you can certainly set the TransformManager's scaleFromCenter property to true. Does that help?

Link to comment
Share on other sites

By its very nature, scaling must change the selected object's x/y position unless its registration point happens to line up directly on the overall selection's origin. If you'd like things to scale from the selection's center, you can certainly set the TransformManager's scaleFromCenter property to true. Does that help?

 

I tried the scaleFromCenter, it also update the object x/y position. In my case i am expecting scale should only perform with reference to top left point of transform.

 

is there any option through which we can set top left point as registration point?

Link to comment
Share on other sites

There isn't a way to set a custom registration point, no. Sorry. You can certainly set the scaleX/scaleY of your element directly, though (not through TransformManager) and then updateSelection() if you'd like. Our tweening engine has a transformAroundPoint plugin that would allow you to scale a single target around a particular point, regardless of its registration point. The bigger challenge with TransformManager is that it accommodates multiple selections which could all be at different rotations/scales/positions (that makes it much more difficult). 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...