-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit event from Shapes data setter (#6134)
# Fixes/Closes Closes #6125 # Description With #6117 the emitted data in the `data.setter` of `Points` has been made more consistent with the emitted data when adding, changing or removing data within the layer. However, in `Shapes` only the data itself was emitted. Furthermore, since the `data.setter` in Shapes called the public `.add` method and emits data itself, a `layers.data` event was emitted twice. This PR is a slight refactor so that `data.setter` can directly call the private `_add_shapes` method, bypassing the `layer.data` emit in `.add`. ## Type of change - [x] Bug-fix (non-breaking change which fixes an issue) - [x] Maintenance (changes required to run napari, tests, & CI smoothly) # How has this been tested? - [x] example: the test suite for my feature covers cases x, y, and z - [x] example: all tests pass with my change - [x] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have added tests that prove my fix is effective or that my feature works - [x] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
- Loading branch information
Showing
2 changed files
with
49 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters