pixi-viewport
pixi-viewport copied to clipboard
Fix scrolling while pressing shift on macos
On macOS, if shift is pressed (and the mouse does not have a horizontal scroll wheel), a horizontal scroll is executed. This means that e.deltaY is 0 and zooming does not work.
This PR checks if a shift key is pressed and, if deltaX is not 0, it uses e.deltaX instead of e.deltaY to calculate the zoom change.
Is there any way to ensure this doesn't break non-macos implementations?
Is there any way to ensure this doesn't break non-macos implementations?
Unfortunately I don't have a mouse with horizontal scrolling capability, that would be the only way to check this. But we could do a check on navigator.platform
I'm going to close this. If someone needs this functionality, please reopen and push a navigator check. i have no way of testing this.