jivory

Disabling DESELECT for outside Text edits

Recommended Posts

Hey guys,

I have the TransformManager in an application, that will edit text fields.

 

My idea, is to have text, selectable by the TransformManager. Then within another component, alter the text object, with a font drop down, colors, text, etc.

My issue I'm seeing, is once the text TransformItem is selected, then any other item clicked on, it deselects the text TransformItem.

 

Does anyone have any thoughts or ideas how I would accomplish this?

 

I've thought, I could store the item in an object, and just make the edits, and they could change the text, without the text TransformItem actually being selected, which is fine, it doesn't necessarily need to be selected the whole time, I just need a pointer so it knows what item to change.

The visual problem with this, is the handles are removed from the item, showing it is no longer selected, so it could be confusing on which item is being altered.

 

Any suggestion on how I might either keep the item selected with the TransformManager, while clicking other items and not deselecting the item, or show that the item is still 'selected' even when the TransformManager releases it?

 

Thanks

Share this post


Link to post
Share on other sites

I found one method.

 

In my component, outside the TransformManager that will edit the TransformItems, if the objects in there receive a mouse event, I simply $e.stopImmediatePropagation(); and $e.preventDefault(); which prevents the TransformManager from deselecting the items.

 

If anyone has any other (better) suggestions I'd love to hear them!

Thanks

Share this post


Link to post
Share on other sites

Good find, jivory. That is probably best. Better than setting autoDeselect to false and trying to manually manage selections.

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.