pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

Fix scrolling while pressing shift on macos

Open saschagehlich opened this issue 4 years ago • 2 comments

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.

saschagehlich avatar Oct 27 '21 16:10 saschagehlich

Is there any way to ensure this doesn't break non-macos implementations?

davidfig avatar Oct 28 '21 16:10 davidfig

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

saschagehlich avatar Nov 01 '21 12:11 saschagehlich

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.

davidfig avatar Aug 13 '22 12:08 davidfig