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

@ -1,4 +1,5 @@
desktop: add divemode as a possible dive list column
profile-widget: Now zomed in profiles can be panned with horizontal scroll.
desktop: hide only events with the same severity when 'Hide similar events' is used
equipment: mark gas mixes reported by the dive computer as 'inactive' as 'not used'
equipment: include unused cylinders in merged dive if the preference is enabled

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)