Skip to content

Commit

Permalink
Avoid resetting old subsets to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Dec 27, 2023
1 parent 41990e0 commit 85e9816
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jdaviz/configs/default/plugins/subset_plugin/subset_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85e9816

Please sign in to comment.