# HG changeset patch # User Rik # Date 1578010086 28800 # Node ID 33219a1a613368babf9389cff0ee24fb4dcf8a93 # Parent bfa80cf7c1db0d79117c70d33341e6af40ea80b2 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. diff -r bfa80cf7c1db -r 33219a1a6133 libgui/graphics/Canvas.cc --- 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