Skip to content

Commit

Permalink
Make sure the removal of the slit patch correctly results in events
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 3, 2021
1 parent 1b79541 commit 1d0e35b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jdaviz/configs/mosviz/plugins/slit_overlay/slit_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,10 @@ def place_slit_overlay(self, *args, **kwargs):
def remove_slit_overlay(self):
if self._slit_overlay_mark is not None:
image_figure = self.app.get_viewer("image-viewer").figure
image_figure.marks.remove(self._slit_overlay_mark)
# We need to do the following instead of just removing directly on
# the marks otherwise traitlets doesn't register a change in the
# marks.
marks = image_figure.marks.copy()
marks.remove(self._slit_overlay_mark)
image_figure.marks = marks
self._slit_overlay_mark = None

0 comments on commit 1d0e35b

Please sign in to comment.