changeset 19793:ed1bafbb87ee

allow mouse wheel zoom amount to be configurable for qt graphics (bug #44304) * Canvas.cc (Canvas::canvasWheelEvent): Use mousewheelzoom axes property to compute zoom factor.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Feb 2015 01:30:54 -0500
parents a5206dfbaa13
children 47440b762547
files libgui/graphics/Canvas.cc
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc	Thu Feb 19 01:26:52 2015 -0500
+++ b/libgui/graphics/Canvas.cc	Thu Feb 19 01:30:54 2015 -0500
@@ -688,7 +688,13 @@
               {
                 axes::properties& ap = Utils::properties<axes> (axesObj);
 
-                double factor = event->delta () > 0 ? 2.0 : 0.5;
+                // Control how fast to zoom when using scroll wheel.
+                double wheel_zoom_speed = ap.get_mousewheelzoom ();
+
+                // Determine if we're zooming in or out.
+                double factor = (event->delta () > 0
+                                 ? 1 / (1.0 - wheel_zoom_speed)
+                                 : 1.0 - wheel_zoom_speed);
 
                 ap.zoom (mode, factor);