diff --git a/CHANGES.rst b/CHANGES.rst index 558df7d21a..fbb930cb86 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -73,6 +73,8 @@ Other Changes and Additions Bug Fixes --------- +- Changing the angle of a subset no longer sometimes applies that angle to subsequent new subsets. [#2639] + Cubeviz ^^^^^^^ diff --git a/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py b/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py index af20ddf8e5..eec3596ff5 100644 --- a/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py +++ b/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py @@ -93,6 +93,12 @@ def _sync_selected_from_state(self, *args): if self.subset_selected != self.subset_select.default_text: self.subset_selected = self.subset_select.default_text self.show_region_info = False + # Ditch the previous ROI if it was saved on the tool + for viewer_id in self.app._viewer_store: + viewer = self.app.get_viewer(viewer_id) + if hasattr(viewer.toolbar.active_tool, "_roi"): + viewer.toolbar.active_tool._roi = None + else: new_label = self.session.edit_subset_mode.edit_subset[0].label if new_label != self.subset_selected: @@ -103,7 +109,7 @@ def _sync_selected_from_state(self, *args): def _on_subset_update(self, *args): self._sync_selected_from_state(*args) - if 'Create New' in self.subset_selected: + if 'create new' in self.subset_selected.lower(): return self._get_subset_definition(*args) subset_to_update = self.session.edit_subset_mode.edit_subset[0]