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

Fix updating coordinate displaying when blinking via click #1470

Merged
merged 2 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -34,6 +34,8 @@ Specviz
Bug Fixes
---------

- Fix updating coordinate display when blinking via click. [#1470]

Cubeviz
^^^^^^^

Expand Down
6 changes: 5 additions & 1 deletion jdaviz/configs/imviz/plugins/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Contributor

@pllim pllim Jul 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you really want to test this, you can write a test that is not unlike what is being done in https://github.com/spacetelescope/jdaviz/blob/main/jdaviz/configs/imviz/tests/test_linking.py 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since that test already uses the "b" key twice, I just changed one of them to make use of the click (so that we have coverage for both cases).

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):
Expand Down