wkentaro / labelme

Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).
https://labelme.io
Other
13.59k stars 3.42k forks source link

Fix Side scroll request in the wheelEvent with the shift modifier in qt5 mode #1472

Open Kokika opened 3 months ago

Kokika commented 3 months ago

This is fix for QT5. Convient function for side scrolling on canvas with shift modifier. This idea copied other program behavior.

wkentaro commented 1 month ago

@Kokika looks like qt5 ev.angleDelta() handles it automatically. (I confirmed on my macOS + PyQt5)

https://doc.qt.io/qt-5/qwheelevent.html

image
Kokika commented 1 month ago

@wkentaro I am testing on Ubuntu 24.04 with PyQt5 5.15.9 and here it isn't handles it automatically.

wkentaro commented 1 month ago

I see, but your change breaks the other systems where qt5 automatically flips the order (because you flip again), so I can't merge.

We need to understand why qt5 won't work for you.

Kokika commented 1 month ago

I realized it and I totally agree. I am searching the reason.

Kokika commented 1 month ago

@wkentaro Could you test it if the shift modifier is in mods? Or maybe it is applied and take away from the mods on Mac os?

wkentaro commented 1 month ago

@Kokika I tested on my Linux machine, and reproduced your phenomenon.

And on macOS, shift modifier is in mods (so your change makes it both horizontal scroll regardless of shift press).

Probably we need to add if-block for platform...

Kokika commented 1 month ago

I tested this on Windows and same like Linux, so it is also need.

Kokika commented 1 month ago

I added Mac os check for side scroll. @wkentaro, could you test it please?