Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

objectActivated doesn't get called when object gets unselected #683

Open
yennor opened this issue Dec 3, 2021 · 6 comments
Open

objectActivated doesn't get called when object gets unselected #683

yennor opened this issue Dec 3, 2021 · 6 comments
Labels
Enhancement Enhance performance or improve usability of original features.

Comments

@yennor
Copy link

yennor commented Dec 3, 2021

Describe the bug
ObjectActivated gets properly called when clicking on an object and it gets selected. But when clicking somewhere where no object is, it should also be called, just for example with null. Otherwise it is impossible for the application to know if there is really a selected object or not.

To Reproduce
Steps to reproduce the behavior:

  1. Click on an object in the image
  2. objectactivated gets called with that object
  3. Click on an empty space in the image
  4. object activated doesn't get called. The application still thinks the previous ovject is selected.

Expected behavior
ObjectActivated should always be called. Or otherwise there needs to be a callback when all objects are unselected.

@yennor yennor added the Bug label Dec 3, 2021
@lja1018
Copy link
Contributor

lja1018 commented Dec 8, 2021

@yennor
The objectActivated event is an event that occurs when an unspecified object is activated.
It's hard to expect it to happen when it's deselected. Please refer to this link.

@yennor
Copy link
Author

yennor commented Dec 8, 2021

I expected it to send me a null reference, to inform me, that "nothing" has been activated. In general a notification when the activatedObject changes. Also when the activatedObject changes to none, that would be some kind of activation ;-).
My usecase for that is pretty simple.
In the user interface I've got, some buttons need to be deactivated, when no object is selected. Right now it seems to be impossible to find out, that no object is activated at all.
I could also imagine use case, where depending on what kind of object is activated, different user interface elements would be displayed.

@lja1018
Copy link
Contributor

lja1018 commented Dec 14, 2021

@yennor
How about using selectionClear to determine that there is no activated object?

@yennor
Copy link
Author

yennor commented Dec 14, 2021

you mean as a new event? Because if that one already exists, I really can't find it.

Yes that would also work :-). Maybe in the documentation for objectActivated mention the other event, so nobody would oversee it.

@lja1018
Copy link
Contributor

lja1018 commented Dec 15, 2021

@yennor
I will consider improving the event name. Thank you for the suggestion. :)

@yennor
Copy link
Author

yennor commented Dec 15, 2021

cool, thanks :-)

@lja1018 lja1018 added Enhancement Enhance performance or improve usability of original features. and removed Bug labels Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Enhance performance or improve usability of original features.
Projects
None yet
Development

No branches or pull requests

2 participants