From 85e9816135a05251a2f1bf0d1fa429479667dc08 Mon Sep 17 00:00:00 2001 From: Ricky O'Steen Date: Wed, 27 Dec 2023 11:26:43 -0500 Subject: [PATCH] Avoid resetting old subsets to 0 --- .../configs/default/plugins/subset_plugin/subset_plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py b/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py index fdef1dfc9a..eec3596ff5 100644 --- a/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py +++ b/jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py @@ -93,12 +93,11 @@ 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 - # Reset theta to 0 if we're creating a new subset + # 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"): - if hasattr(viewer.toolbar.active_tool._roi, "theta"): - viewer.toolbar.active_tool._roi.theta = 0 + viewer.toolbar.active_tool._roi = None else: new_label = self.session.edit_subset_mode.edit_subset[0].label