Open fedulvtubudul opened 2 years ago
Thank you for this fix. I hope few other users can test this and share their experience with fix as well. If i remember correctly, i've merged similar thing some time ago and it ended up breaking zoom for some of the users (while fixing it for others). So i will test it myself on ArchLinux/X11 and hopefully we can get feedback from users on other platforms as well.
Ok thanks, can you please resolve the conflicts, so we can merge?
This PR fixes https://github.com/vlachoudis/bCNC/issues/804
Here is original zoom wheel handler code:
event.delta
equals -1 (scroll up) or 1 (scroll down) on my setup (MacOS 12.2.1, Logitech MX 3 mouse, medium scrolling speed in system settings, "natural" scroll direction). In Python 2 rounding goes away from zero, soevent.delta//120
gives either 1 or -1, which is OK. But running in Python 3.9,event.delta//120
results -1 or 0. That why only one zooming direction works.I propose a fix that seems compatible both with Python 2 and 3 and should not break or change scrolling behavior.