lospec/pixel-editor

Broken zoom because of an undefined attribute

Lattay opened this issue · 2 comments

Describe the bug
When trying to zoom with the mouse wheel, an exception is raised in the check for a menu item (or something ?)

path is undefined.

To Reproduce
Steps to reproduce the behavior:

  1. Open the editor
  2. Open the developer console of the browser
  3. Scroll with the mouse wheel on the canvas
  4. See error TypeError: mouseEvent.path is undefined

Expected behavior
Zooming (also I am not sure what is the point of view on zoom right now, seeing #103)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Firefox
  • Version: 108

Additional context
The mouseEvent object should be a WheelEvent.
There is no such path attribute documented, I don't know where it is supposed to come from.

Note that I tried to comment this line (and the one below) in a development instance of the app (on current master, namely 5d55425) and the zoom worked as expected.

Looks like path is not supported by FireFox. Let me know if you want to fix the bug on your own or wait for us (unfortunately there aren't many active contributors, even though they're more than welcome). In case you want to work on the bug these links might be useful:
https://stackoverflow.com/questions/39245488/event-path-is-undefined-running-in-firefox
https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath

No problem, I'll fix it.