Jump to content
Search Community

Individual TransformItem Selection when Multi-Selected

lakitu41 test
Moderator Tag

Recommended Posts

We have been using TransformManager with great results in our Flex application. I have been asked to look into changing the multi-select behavior to have selection boxes around each individual TransformItem rather than the current behavior of the single box around all of the selected fields. In the new behavior if you were to drag the rotate handle of one item and move it all fields would rotate as if you had performed the same action on them rather than all of them rotating around the center of the single selection box. I was wondering if anybody else has tried/considered this and what possible pitfalls I might run into.


I have done a bit of research and know I would have to move all the dummyBox, edge box, and handle graphics down into the TransformItem. All of the handlers for the handles would also have to be moved down (rotate start, rotating, rotate end, etc...)


I think this first part would have some difficulties, but what concerns me more is the next part of notifying all the selected items as an action is performed on one OR figuring out the safe zone for actions because I would need to figure out the safe change for each TransformItem and keep track of the smallest possible change.


Any thoughts on the issue would be greatly appreciated. And yes I do understand that this is a very large undertaking and am not looking forward to attempting it ;-)

Link to comment
Share on other sites

Yeah, that's a pretty major undertaking quite frankly. You're right - you'd need to make sure you impose boundaries correctly so that as you rotate one object, the others don't leave the bounds. And on top of that, you'd need to create new selection boxes (with handles I assume) for every object instead of reusing a single instance.


Good luck with the project.

Link to comment
Share on other sites

  • 1 month later...

Wanted to provide an update on this post.  I was able to successfully implement an individual item selection mode, which would put a selection box and set of handles around each selected item.  It mostly involved replicating the selection box and handle drawing that existed in the TransformManager down to the TransformItem.  I also had to move all of the mouse event handling for the handles down too.


In the end if you performed an action on any of the selected items the changes would bubble up and be performed on all of the selected items.  I was able to enforce the various checks (scaleCheck, moveCheck, etc.) by performing the check iteratively on each item, which would ultimately provide the maximum "legal" change for each shape.  Once the safe value was determined the change was applied to each of the selected items.

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