Jump to content
Search Community

Selection position not updated for TransformEvent.SCALE

Movix test
Moderator Tag

Recommended Posts

hi,

 

During scaling process i listen to TransformEvent.SCALE

when this event is fired, the properties selectionX and selectionY are not updated, they stay identical and are only refresh after scaling is finished.

 

I the way i gather these datas wrong ?

How do i have to proceed in order to get the accurate position of the current selection during scaling process ?

 

Movix

Link to comment
Share on other sites

That's not a bug - it's just that whenever you scale, the origin is always stationary. In other words, if you grab the lower left corner handle, the scale origin will be the upper right corner, and that's what determines the x and y position of the selection. What exactly are you trying to figure out? The upper left corner of the selection? The upper left corner of the bounds of the selection?

Link to comment
Share on other sites

hi,

 

sorry, i did not want to say that it is a bug :)

 

i'll want to have the upper left X and Y values during resize in order to display these values.

so if i can figure out witch point is the stationary one i gues i can compute it buy my self.

 

you are specifying an interesting question distinguishing selection and selection bounds.

 

I also display the size of a selection. if only one item is selected, i have a context frame displaying a lot of information about the selected item, also the size. I gather this data out of the selectedTargetObjects.

In addition to that i have a global size and position display that takes it's data from SelectionX, Y and getUnrotatedSelectionWidth(), Height(). I notices that there is a very small diference of the size data when i compare the SelectedTargetObjects size and the getUnrotatedSelection Size.

Perhaps you have a hint for me how to avoid this difference, or what is is due to in order to correct my displayed values to be identical.

 

Movix

Link to comment
Share on other sites

I notices that there is a very small diference of the size data when i compare the SelectedTargetObjects size and the getUnrotatedSelection Size.

Perhaps you have a hint for me how to avoid this difference, or what is is due to in order to correct my displayed values to be identical.

 

getUnrotatedSelectionWidth() (or height) gives you the size based on if you took the current selection and unrotated the whole thing together, NOT as though it unrotates each item in the selection individually. So the items themselves could still be rotated, but the selection box wouldnt' be. See the difference? Maybe that's why you're getting slightly different values. If you're still having trouble with it, please post a sample that demonstrates the problem (the simpler the better). Don't post the GreenSock classes - just your stuff. And zip it before posting please.

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...