Skip to content

Commit

Permalink
WIP: Investigation went nowhere.
Browse files Browse the repository at this point in the history
This needs clean-up for production.
[ci skip]
  • Loading branch information
pllim committed Jun 22, 2022
1 parent 9bb8aa4 commit c0931d0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ def resize(stack_items):
# TODO: set appropriate viewer.zoom_level
# TODO: box-zoom to act based on overscaled canvas
# viewer = self._viewer_by_id(args[0]['viewer'])
# viewer.zoom_level = 'fit' # Did not see any difference, also tried 0.5
pass

def vue_destroy_viewer_item(self, cid):
Expand Down
7 changes: 4 additions & 3 deletions jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def vue_rotate_image(self, *args, **kwargs):
except Exception:
return

# Rotate selected viewer canvas
viewer = self.app._viewer_by_id(self.viewer_selected)

# Rotate selected viewer canvas. This changes zoom too.
self.app._viewer_item_by_id(self.viewer_selected)['rotation'] = self._theta

# Update Compass
viewer = self.app._viewer_by_id(self.viewer_selected)
# Update Compass plugin.
viewer.on_limits_change()
9 changes: 9 additions & 0 deletions jdaviz/configs/imviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ def _get_real_xy(self, image, x, y):

return x, y, coords_status

# TODO: Remove if we end up not using it.
# def _get_zoom_center(self, image):
# """Return ``(x, y)`` of the center of zoom for a given image.
# Also see :meth:`_get_zoom_limits`.
# """
# x_cen = (self.state.x_min + self.state.x_max) * 0.5
# y_cen = (self.state.y_min + self.state.y_max) * 0.5
# return self._get_real_xy(image, x_cen, y_cen)[:2]

def _get_zoom_limits(self, image):
"""Return a list of ``(x, y)`` that defines four corners of
the zoom box for a given image.
Expand Down

0 comments on commit c0931d0

Please sign in to comment.