diff libgui/graphics/Canvas.cc @ 29054:226df400639c

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Thu, 12 Nov 2020 02:02:39 -0500
parents 1ac5a76ae91d 440ace36950e
children 7854d5752dd2
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc	Wed Nov 11 14:55:09 2020 -0500
+++ b/libgui/graphics/Canvas.cc	Thu Nov 12 02:02:39 2020 -0500
@@ -920,7 +920,12 @@
 
             if (childObj.isa ("axes"))
               {
-                graphics_object go = selectFromAxes (childObj, event->pos ());
+#if defined (HAVE_QWHEELEVENT_POSITION)
+                QPoint pos = event->position().toPoint ();
+#else
+                QPoint pos = event->pos ();
+#endif
+                graphics_object go = selectFromAxes (childObj, pos);
 
                 if (go)
                   {
@@ -946,7 +951,11 @@
 
                 if (zoom_enabled (figObj))
                   {
+#if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
+                    if (event->angleDelta().y () > 0)
+#else
                     if (event->delta () > 0)
+#endif
                       newMouseMode = ZoomInMode;
                     else
                       newMouseMode = ZoomOutMode;
@@ -988,7 +997,11 @@
                 {
                   axes::properties& ap = Utils::properties<axes> (axesObj);
 
+#if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
+                  double factor = (event->angleDelta().y () > 0 ? 0.1 : -0.1);
+#else
                   double factor = (event->delta () > 0 ? 0.1 : -0.1);
+#endif
 
                   if (event->modifiers () == Qt::NoModifier
                       && mode != "horizontal")