Skip to content

Commit

Permalink
Disable ROIs in 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed Jun 13, 2024
1 parent d0e72e4 commit d0eaa45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ndv/viewer/_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ def set_current_index(self, index: Indices | None = None) -> None:
def _toggle_3d(self) -> None:
self.set_ndim(3 if self._ndims == 2 else 2)

# Disable ROIs in 3D (for now)
self._add_roi_btn.setEnabled(self._ndims == 2)
if self._roi is not None:
self._roi.visible = self._ndims == 2

Check warning on line 427 in src/ndv/viewer/_viewer.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/viewer/_viewer.py#L425-L427

Added lines #L425 - L427 were not covered by tests

def _update_slider_ranges(self) -> None:
"""Set the maximum values of the sliders.
Expand Down Expand Up @@ -625,4 +630,4 @@ def new_key_press(event: QMouseEvent) -> None:
# Proceed with normal mouse release
return old_method(event)

Check warning on line 631 in src/ndv/viewer/_viewer.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/viewer/_viewer.py#L631

Added line #L631 was not covered by tests

return new_key_press
return new_key_press

Check warning on line 633 in src/ndv/viewer/_viewer.py

View check run for this annotation

Codecov / codecov/patch

src/ndv/viewer/_viewer.py#L633

Added line #L633 was not covered by tests

0 comments on commit d0eaa45

Please sign in to comment.