Bharat Patel

How to scale selected object without changing its current position?

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

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
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). 

Share this post


Link to post
Share on other sites

I understand the challenge with TransformManager. I will handle it directly over element and after that 

_transformManager.updateSelection() 

With the alternate option will achieve my goal.

 

Thank for response. :)

Share this post


Link to post
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.