Use horizontal mouse wheel for zoomed panning

Signed-off-by: Anton Lundin <glance@ac2.se>
This commit is contained in:
Anton Lundin 2023-10-11 21:34:18 +02:00 committed by Michael Keller
parent bfe61b2dff
commit b6111714b3
2 changed files with 9 additions and 0 deletions

View file

@ -322,6 +322,14 @@ void ProfileWidget2::wheelEvent(QWheelEvent *event)
{
if (!d)
return;
if (event->angleDelta().x() && zoomLevel > 0) {
double oldPos = zoomedPosition;
zoomedPosition = profileScene->calcZoomPosition(calcZoom(zoomLevel),
oldPos,
oldPos - event->angleDelta().x());
if (oldPos != zoomedPosition)
plotDive(d, dc, RenderFlags::Instant | RenderFlags::DontRecalculatePlotInfo);
}
if (panning)
return; // No change in zoom level while panning.
if (event->buttons() == Qt::LeftButton)