-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Moving points does not emit data change event #2260
Comments
Thanks for filing @jwindhager - I know @jni has flagged this too. It is because we modify the data in place so the setter isn't called on the napari/napari/layers/points/points.py Lines 1725 to 1727 in edee9af
|
Thanks! Happy to submit a pull request for this. Just want to make sure that this doesn't break things? For example, if some existing plugins do some heavy lifting in the |
That's a reasonable concern, we could do something a little more complex like use a recently added ability to block and count event emission, see #2197. We would add event emission to the points move function after the line I indicated above, but then inside the mouse function we could block event emission when the mouse gets pressed, then when the mouse gets release we could count the number of emitted events, and if greater than 0 we could emit one manually there. Thoughts? cc @jni |
Indeed, affinder specifically writes data each time the affine matrix changes, so this would re-save the affine matrix at each increment. It's tiny but I think that would add up. I like @sofroniewn's proposed solution. |
🐛 Bug
Moving points in the viewer does not emit Points.events.data event
To Reproduce
Steps to reproduce the behavior:
Points.events.data
Expected behavior
To my understanding,
Points.events.data
should be emitted whenever the data changes, so eitherAdditional context
A workaround is possible by additionally listening to mouse drag events. However, it this case, it is unclear how to differentiate between point selection and point move, see #2259.
The text was updated successfully, but these errors were encountered: