Skip to content

fix: horizontal scroll when shift modifier is pressed#1513

Open
ardiya wants to merge 1 commit intowkentaro:mainfrom
ardiya:main
Open

fix: horizontal scroll when shift modifier is pressed#1513
ardiya wants to merge 1 commit intowkentaro:mainfrom
ardiya:main

Conversation

@ardiya
Copy link

@ardiya ardiya commented Nov 13, 2024

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
Copy link
Author

ardiya commented Nov 13, 2024

similar issue: #1504

Copy link
Contributor

@minewilliam minewilliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. This fixes the side scrolling problem on my Linux machine.

@wkentaro
Copy link
Owner

wkentaro commented Jan 24, 2026

It may be Linux specific issue. I can't reproduce on macOS and Windows (it does on Ubuntu).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants