changeset 27901:33219a1a6133

Allow Qt selection rectangle to be slightly larger than axes for ease of use (patch #9763) * Canvas.cc (select_object): Use Qt adjust() to expand selection bounding box to be 20 pixels greater than axes area.
author Rik <rik@octave.org>
date Thu, 02 Jan 2020 16:08:06 -0800
parents bfa80cf7c1db
children 32f4a15c77c7
files libgui/graphics/Canvas.cc
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc	Fri Jan 03 00:22:04 2020 +0100
+++ b/libgui/graphics/Canvas.cc	Thu Jan 02 16:08:06 2020 -0800
@@ -422,6 +422,10 @@
                 Matrix bb = it->get_properties ().get_boundingbox (true);
                 QRectF r (bb(0), bb(1), bb(2), bb(3));
 
+                // Allow a rectangle (e.g., Zoom box) to be slightly outside
+                // the axes and still select it.
+                r.adjust (-20, -20, 20, 20);
+
 #if defined (HAVE_QMOUSEEVENT_LOCALPOS)
                 bool rect_contains_pos = r.contains (event->localPos ());
 #else