diff --git a/jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py b/jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py index 6cf829bf4c..829231b04f 100644 --- a/jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py +++ b/jdaviz/configs/imviz/plugins/rotate_image/rotate_image.py @@ -27,7 +27,9 @@ def vue_rotate_image(self, *args, **kwargs): # Rotate selected viewer canvas. # TODO: This changes zoom too? astrofrog will fix translation issue? - affine_transform = Affine2D().rotate_deg(self._theta) + y_hub = (viewer.scales['y'].min + viewers.scales['y'].max) / 2 + x_hub = (viewer.scales['x'].min + viewer.scales['x'].max) / 2 + affine_transform = Affine2D().rotate_deg_around(y_hub, x_hub, self._theta) viewer.state.affine_matrix = affine_transform # TODO: Does the zoom box behave? If not, we need to disable it.