wkentaro / labelme

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

fix: horizontal scroll when shift modifier is pressed #1513

Open ardiya opened 2 weeks ago

ardiya commented 2 weeks ago

Issue:

Both Scroll and Shift+Scroll resulted in vertical(up-down) scrolling in QT5.

It seems the else(QT5) condition properly handle the shift+scroll condition, ref: https://github.com/ardiya/labelme/blob/57fbf2b9a749cd77ac5f03f005ee6206d671ece8/labelme/widgets/canvas.py#L928-L929 So I just need to handle the QT5 condition.

Expected result:

In Qt5, the Shift+Scroll should result in horizontal(left-right) scroll.

Proposed Fix: This PR

When Shift modifier is pressed, use the y dimension of the scroll and use it to scroll horizontally.

Tested with shift and without shift, the code changes produces expected behavior.

ardiya commented 2 weeks ago

similar issue: https://github.com/wkentaro/labelme/issues/1504