changeset 19796:eebe8da58f8d

allow shift + left button to zoom out (bug #44304) * Canvas.cc (Canvas::canvasMouseReleaseEvent): Allow shift + left button to zoom out.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Feb 2015 01:52:45 -0500
parents 74b5209ad68d
children 84772c272288
files libgui/graphics/Canvas.cc
diffstat 1 files changed, 31 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc	Thu Feb 19 01:47:14 2015 -0500
+++ b/libgui/graphics/Canvas.cc	Thu Feb 19 01:52:45 2015 -0500
@@ -519,20 +519,22 @@
         case ZoomMode:
           if (axesObj)
             {
-              if (event->buttons () == Qt::LeftButton
-                  && event->modifiers () == Qt::NoModifier)
-                {
-                  m_mouseAnchor = m_mouseCurrent = event->pos ();
-                  m_mouseAxes = axesObj.get_handle ();
-                  m_mouseMode = newMouseMode;
-                }
-              else if (event->modifiers () == Qt::NoModifier)
+              bool redraw_figure = true;
+
+              if (event->modifiers () == Qt::NoModifier)
                 {
                   switch (event->buttons ())
                     {
+                    case Qt::LeftButton:
+                      m_mouseAnchor = m_mouseCurrent = event->pos ();
+                      m_mouseAxes = axesObj.get_handle ();
+                      m_mouseMode = newMouseMode;
+                      break;
+
                     case Qt::RightButton:
                       Utils::properties<axes> (axesObj).unzoom ();
                       break;
+
                     case Qt::MidButton:
                         {
                           axes::properties& ap =
@@ -544,11 +546,31 @@
                           ap.set_zlimmode ("auto");
                         }
                       break;
+
+                    default:
+                      redraw_figure = false;
+                      break;
                     }
-                  redraw (false);
                 }
+              else if (event->modifiers () == Qt::ShiftModifier)
+                {
+                  switch (event->buttons ())
+                    {
+                    case Qt::LeftButton:
+                      Utils::properties<axes> (axesObj).unzoom ();
+                      break;
+
+                    default:
+                      redraw_figure = false;
+                      break;
+                    }
+                }
+
+              if (redraw_figure)
+                redraw (false);
             }
           break;
+
         default:
           break;
         }