From 57fbf2b9a749cd77ac5f03f005ee6206d671ece8 Mon Sep 17 00:00:00 2001 From: "Ardiya, Aditya" Date: Wed, 13 Nov 2024 13:34:49 +0900 Subject: [PATCH] fix: horizontal scroll when shift modifier is pressed --- labelme/widgets/canvas.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/labelme/widgets/canvas.py b/labelme/widgets/canvas.py index d71a6125b..ea09a6b80 100644 --- a/labelme/widgets/canvas.py +++ b/labelme/widgets/canvas.py @@ -908,6 +908,9 @@ def wheelEvent(self, ev): # with Ctrl/Command key # zoom self.zoomRequest.emit(delta.y(), ev.pos()) + elif mods == QtCore.Qt.ShiftModifier: + # 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)