Skip to content

Commit

Permalink
fix: horizontal scroll when shift modifier is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
ardiya committed Nov 13, 2024
1 parent b9c83ff commit 7c14add
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions labelme/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,9 @@ def wheelEvent(self, ev):
# with Ctrl/Command key
# zoom
self.zoomRequest.emit(delta.y(), ev.pos())
elif QtCore.Qt.ShiftModifier == int(mods):
# Convert wheel y(up down) direction to horizontal scroll with Shift key
self.scrollRequest.emit(delta.y(), QtCore.Qt.Horizontal)
else:
# scroll
self.scrollRequest.emit(delta.x(), QtCore.Qt.Horizontal)
Expand Down

0 comments on commit 7c14add

Please sign in to comment.