Skip to content

Commit

Permalink
Graph: support Ctrl+Shift zoom
Browse files Browse the repository at this point in the history
Ref: #320
  • Loading branch information
rodlie committed Dec 1, 2024
1 parent fdb4455 commit e3c1668
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/GUI/graphboxeslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,13 @@ void KeysView::graphWheelEvent(QWheelEvent *event)
#ifdef Q_OS_MAC
if (event->angleDelta().y() == 0) { return; }
#endif
if (event->modifiers() & Qt::ControlModifier) {
const bool ctrl = (event->modifiers() & Qt::ControlModifier);
const bool shift = (event->modifiers() & Qt::ShiftModifier);
if (ctrl && !shift) {
emit wheelEventSignal(event);
return;
} else if (event->modifiers() & Qt::ShiftModifier) {
} else if (ctrl || shift) {
if (ctrl) { emit wheelEventSignal(event); }
qreal valUnderMouse;
qreal frame;
const auto ePos = event->position();
Expand All @@ -509,6 +512,7 @@ void KeysView::graphWheelEvent(QWheelEvent *event)
(valUnderMouse - mMinShownVal)*graphScaleInc);
mPixelsPerValUnit += graphScaleInc*mPixelsPerValUnit;
graphUpdateDimensions();
if (ctrl) { return; }
} else {
if (event->angleDelta().y() > 0) { graphIncMinShownVal(1); }
else { graphIncMinShownVal(-1); }
Expand Down

0 comments on commit e3c1668

Please sign in to comment.