Jump to content
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.