diff libgui/graphics/Canvas.h @ 20142:f1f6d5eab46f

Draw a zoom-like box when creating an annotation interactively * Canvas.h: new private state variable m_rectMode * Canvas.cc (Canvas::canvasMousePressEvent): in text mode, initialize m_mouseAnchor, m_mouseCurrent, m_mouseAxes m_mouseMode = newMouseMode, m_rectMode = true for drawing the box; Remove call to anno_dlg. * Canvas.cc (Canvas::canvasMouseMoveEvent): track mouse position as in zoom mode * Canvas.cc (Canvas::canvasMouseReleaseEvent): use the anchor and current mouse coordoinates to define the position, and then call annot_dlg. * annotation-dialog.ui: allow negative values for width and height
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Mon, 20 Apr 2015 22:13:09 +0200
parents c6c5cb9c4743
children 248f2f2e7d48
line wrap: on
line diff
--- a/libgui/graphics/Canvas.h	Mon Apr 20 09:26:13 2015 +0200
+++ b/libgui/graphics/Canvas.h	Mon Apr 20 22:13:09 2015 +0200
@@ -84,7 +84,8 @@
       m_redrawBlocked (false),
       m_mouseMode (NoMode),
       m_clickMode (false),
-      m_eventMask (0)
+      m_eventMask (0),
+      m_rectMode (false)
     { }
 
   void canvasToggleAxes (const graphics_handle& handle);
@@ -113,6 +114,7 @@
   QPoint m_mouseCurrent;
   graphics_handle m_mouseAxes;
   int m_eventMask;
+  bool m_rectMode;
 };
 
 }; // namespace QtHandles