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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vispy errors on double click on canvas #3518

Closed
Czaki opened this issue Oct 25, 2021 · 5 comments
Closed

Vispy errors on double click on canvas #3518

Czaki opened this issue Oct 25, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@Czaki
Copy link
Collaborator

Czaki commented Oct 25, 2021

馃悰 Bug

When during right-click on the canvas and moving view the left button is clicked then many of these exceptions show in terminal

14:02:30 WARNING Traceback (most recent call last):
  File "/home/czaki/.pyenv/versions/napari/bin/napari", line 33, in <module>
    sys.exit(load_entry_point('napari', 'console_scripts', 'napari')())
  File "/home/czaki/Projekty/napari/napari/__main__.py", line 431, in main
    _run()
  File "/home/czaki/Projekty/napari/napari/__main__.py", line 324, in _run
    run(gui_exceptions=True)
  File "/home/czaki/Projekty/napari/napari/_qt/qt_event_loop.py", line 391, in run
    app.exec_()
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/app/backends/_qt.py", line 567, in event
    out = super(QtBaseCanvasBackend, self).event(ev)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/app/backends/_qt.py", line 532, in mouseMoveEvent
    self._vispy_mouse_move(
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/app/base.py", line 216, in _vispy_mouse_move
    ev = self._vispy_canvas.events.mouse_move(**kwargs)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/util/event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/util/event.py", line 469, in _invoke_callback
    cb(event)
  File "/home/czaki/Projekty/napari/napari/_vispy/canvas.py", line 84, in _process_mouse_event
    super()._process_mouse_event(event)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/scene/canvas.py", line 369, in _process_mouse_event
    getattr(picked.events, event.type)(scene_event)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/util/event.py", line 453, in __call__
    self._invoke_callback(cb, event)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  << caught exception here: >>
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/util/event.py", line 469, in _invoke_callback
    cb(event)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/scene/cameras/perspective.py", line 225, in viewbox_mouse_event
    self._update_rotation(event)
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/scene/cameras/arcball.py", line 65, in _update_rotation
    Quaternion(*_arcball(self._event_value, wh)) *
  File "/home/czaki/.pyenv/versions/3.8.3/envs/napari/lib/python3.8/site-packages/vispy/scene/cameras/arcball.py", line 104, in _arcball
    x, y = -(2. * x - w) / r, (2. * y - h) / r
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
ERROR: Invoking <bound method Base3DRotationCamera.viewbox_mouse_event of <ArcballCamera at 0x7f3b0d0528e0>> for SceneMouseEvent
14:02:30 ERROR Invoking <bound method Base3DRotationCamera.viewbox_mouse_event of <ArcballCamera at 0x7f3b0d0528e0>> for SceneMouseEvent

To Reproduce

Steps to reproduce the behavior:

  1. load scikit-image -> Binary blobs 3d
  2. Switch to 3d view
  3. during change zoom with right mouse button click left mouse button (keeping right)

Expected behavior

No errors on missclick

Environment

napari: 0.4.13.dev7+g2f6c4377a
Platform: Linux-5.11.0-38-generic-x86_64-with-glibc2.2.5
System: Ubuntu 21.04
Python: 3.8.3 (default, Sep 3 2021, 01:19:46) [GCC 10.3.0]
Qt: 5.15.2
PyQt5: 5.15.4
NumPy: 1.19.5
SciPy: 1.7.1
Dask: 2021.09.0
VisPy: 0.9.2

OpenGL:

  • GL version: 4.6.0 NVIDIA 470.74
  • MAX_TEXTURE_SIZE: 32768

Screens:

  • screen 1: resolution 2560x1440, scale 1.0
  • screen 2: resolution 1920x1080, scale 1.0
  • screen 3: resolution 1920x1080, scale 1.0

Plugins:

  • animation: 0.0.2
  • console: 0.0.4
  • ome-types: 0.2.9
  • platelet-unet-watershed: 0.0.3
  • scikit-image: 0.4.13.dev7+g2f6c4377a
  • svg: 0.1.5

Additional context

Maybe it is vispy bug but it is not part of my expertise and I do not know how to verify it. Maybe @alisterburt and @brisvag could check?

@Czaki Czaki added the bug Something isn't working label Oct 25, 2021
@alisterburt
Copy link
Contributor

thanks for the report @Czaki - I can't reproduce because my mouse doesn't let me click the left button whilst the right is pressed, hopefully @brisvag can chime in

@brisvag
Copy link
Contributor

brisvag commented Oct 25, 2021

Yup, I can reproduce. It seems to only happen in 3D, and when left-clicking while right-dragging. It definitely looks like a vispy bug, and I think I've seen this issue before. My first guess it's that some event handling does not have the right conditional and takes the new event despite it not being the right kind of event...

@brisvag
Copy link
Contributor

brisvag commented Oct 25, 2021

I opened a small PR about this over at vispy/vispy#2244 which should solve the problem!

@brisvag
Copy link
Contributor

brisvag commented Oct 26, 2021

The PR was merged. This should be closed by #3494 as soon as the bugfix release is added and the vispy version bumped there!

@andy-sweet
Copy link
Member

@Czaki : I can't reproduce this on main and looks like the vispy fix that @brisvag made should have been in napari for several months. If this is fixed for you too, please close this issue.

@Czaki Czaki closed this as completed May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants