From: Sylvain Munaut Date: Sun, 28 May 2017 14:53:27 +0000 (+0200) Subject: viewport: Allow smoother zoom using vertical scroll events X-Git-Tag: pulseview-0.4.0~66 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3592f4053b1b9d96869ccfb88a09a1d493ee253f;p=pulseview.git 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 --- 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