fix: exposure wheel only increased when Alt held
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (push) Skipped
CI / test (3.11) (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
Qt xcb/windows swap wheel axes while Alt is held, so angleDelta().y() is 0 and copysign(_, 0) is always positive. Fall back to angleDelta().x() and ignore genuine zero deltas. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1354,7 +1354,13 @@ class SampleCameraImageLabel(QGraphicsView):
|
||||
|
||||
def wheelEvent(self, event: QWheelEvent):
|
||||
if not self.wheel_event_timer.isActive():
|
||||
delta_y = event.angleDelta().y()
|
||||
# Qt's xcb/windows platform plugins swap wheel axes while Alt is held,
|
||||
# so a vertical scroll lands in angleDelta().x() and y() is 0. Without
|
||||
# this fallback, copysign(_, 0) is always positive and Alt+wheel
|
||||
# exposure can only ever increase.
|
||||
delta_y = event.angleDelta().y() or event.angleDelta().x()
|
||||
if delta_y == 0:
|
||||
return
|
||||
match self._state:
|
||||
case SampleCameraImageState.BEAM_MARKING:
|
||||
if event.modifiers() & Qt.KeyboardModifier.AltModifier:
|
||||
|
||||
Reference in New Issue
Block a user