Mercurial > octave-nkf
diff libgui/graphics/Figure.cc @ 19901:6ba3d0f7c6e8
improve mouse zooming for Qt plotting (bug #44302)
* Figure.h (enum MouseMode): Split ZoomMode into ZoomInMode and
ZoomOutMode. Change all uses.
* Canvas.cc (Canvas::canvasMouseReleaseEvent,
Canvas::canvasWheelEvent): Make meaning of zoom factor consistent with
zoom function. Make direction of wheel event consistent with other
programs.
* __init_fltk__.cc (plot_window::handle): Make meaning of zoom factor
consistent with zoom function.
* MouseModeActionGroup.cc (MouseModeActionGroup::MouseModeActionGroup):
Provide buttons for zooming in and out.
* graphics.cc (figure::properties::set_toolkit): Handle zoom direction.
(do_zoom): Make factor > 1 zoom in.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 26 Feb 2015 19:24:59 -0500 |
parents | c9dc27cad3c0 |
children | 781adfc2958c 815db217f6f4 |
line wrap: on
line diff
--- a/libgui/graphics/Figure.cc Thu Feb 26 13:54:11 2015 -0500 +++ b/libgui/graphics/Figure.cc Thu Feb 26 19:24:59 2015 -0500 @@ -179,8 +179,11 @@ case RotateMode: return "rotate"; - case ZoomMode: - return "zoom"; + case ZoomInMode: + return "zoom in"; + + case ZoomOutMode: + return "zoom out"; case PanMode: return "pan"; @@ -204,8 +207,10 @@ return NoMode; else if (mode == "rotate") return RotateMode; - else if (mode == "zoom") - return ZoomMode; + else if (mode == "zoom in") + return ZoomInMode; + else if (mode == "zoom out") + return ZoomOutMode; else if (mode == "pan") return PanMode; else if (mode == "text") @@ -244,6 +249,15 @@ std::string mode = fp.get___mouse_mode__ (); + if (mode == "zoom") + { + octave_scalar_map zm = fp.get___zoom_mode__ ().scalar_map_value (); + + std::string direction = zm.getfield ("Direction").string_value (); + + mode += " " + direction; + } + return mouse_mode_from_string (mode); }