diff --git a/CHANGES.rst b/CHANGES.rst index c97e9b1699..acdf9dcca7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -34,6 +34,8 @@ Specviz Bug Fixes --------- +- Fix updating coordinate display when blinking via click. [#1470] + Cubeviz ^^^^^^^ diff --git a/jdaviz/configs/imviz/plugins/tools.py b/jdaviz/configs/imviz/plugins/tools.py index 43ef2f2538..3c9e586940 100644 --- a/jdaviz/configs/imviz/plugins/tools.py +++ b/jdaviz/configs/imviz/plugins/tools.py @@ -111,9 +111,13 @@ def activate(self): def deactivate(self): self.viewer.remove_event_callback(self.on_click) - def on_click(self, *args): + def on_click(self, data): self.viewer.blink_once() + # Also update the coordinates display. + data['event'] = 'mousemove' + self.viewer.on_mouse_or_key_event(data) + @viewer_tool class MatchBoxZoom(_MatchedZoomMixin, BoxZoom): diff --git a/jdaviz/configs/imviz/tests/test_linking.py b/jdaviz/configs/imviz/tests/test_linking.py index b6298d33c1..dad39ce2ce 100644 --- a/jdaviz/configs/imviz/tests/test_linking.py +++ b/jdaviz/configs/imviz/tests/test_linking.py @@ -39,6 +39,7 @@ def test_wcslink_fallback_pixels(self): assert self.viewer.label_mouseover.world_ra_deg == '' assert self.viewer.label_mouseover.world_dec_deg == '' + # blink image through keypress self.viewer.on_mouse_or_key_event({'event': 'keydown', 'key': 'b', 'domain': {'x': 0, 'y': 0}}) assert self.viewer.label_mouseover.pixel == 'x=00.0 y=00.0' @@ -119,8 +120,9 @@ def test_wcslink_affine_with_extras(self): assert self.viewer.label_mouseover.world_ra_deg == '337.5202808000' assert self.viewer.label_mouseover.world_dec_deg == '-20.8333330600' - self.viewer.on_mouse_or_key_event({'event': 'keydown', 'key': 'b', - 'domain': {'x': 0, 'y': 0}}) + # blink image through clicking with blink tool + self.viewer.toolbar_nested.active_tool_id = 'jdaviz:blinkonce' + self.viewer.toolbar_nested.active_tool.on_click({'domain': {'x': 0, 'y': 0}}) assert self.viewer.label_mouseover.pixel == 'x=00.0 y=00.0' assert self.viewer.label_mouseover.value == '+1.00000e+00 ' assert self.viewer.label_mouseover.world_ra_deg == '337.5202808000'