Skip to content

Commit

Permalink
Zoom the plotter faster with Ctrl
Browse files Browse the repository at this point in the history
  • Loading branch information
LevitatingBusinessMan committed May 23, 2023
1 parent c3ada93 commit fb61c88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,11 @@ void CPlotter::wheelEvent(QWheelEvent * event)
}
else if (m_CursorCaptured == XAXIS)
{
zoomStepX(delta < 0 ? 1.1 : 0.9, px);
// Scroll faster when Ctrl is held
float stepSize = event->modifiers() & Qt::ControlModifier ? 0.3 : 0.1;
// Zoom out or in
float step = 1 + (delta < 0 ? stepSize : -stepSize);
zoomStepX(step, px);
}
else if (event->modifiers() & Qt::ControlModifier)
{
Expand Down

0 comments on commit fb61c88

Please sign in to comment.