From 3592f4053b1b9d96869ccfb88a09a1d493ee253f Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Sun, 28 May 2017 16:53:27 +0200 Subject: [PATCH 1/1] viewport: Allow smoother zoom using vertical scroll events The zoom supports 'double' as input type but since delta() and 120 are integer, this wasn't used and any event with a delta lower than 120 was ignored. With this mod, the zoom level changes are _much_ smoother on trackpads Signed-off-by: Sylvain Munaut --- pv/view/viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index a179cef1..70282d29 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -210,7 +210,7 @@ void Viewport::wheelEvent(QWheelEvent *event) (event->delta() * height()) / (8 * 120)); } else { // Vertical scrolling is interpreted as zooming in/out - view_.zoom(event->delta() / 120, event->x()); + view_.zoom(event->delta() / 120.0, event->x()); } } else if (event->orientation() == Qt::Horizontal) { // Horizontal scrolling is interpreted as moving left/right -- 2.30.2