Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset angle to 0 for new subsets #2639

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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]
Expand Down
Loading