From 3f728e61d4770f4d36e79cf6ddfc36b986e2b768 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 30 Oct 2015 15:55:36 +0100 Subject: [PATCH] Left click fix - No more need to move the mouse to select a facet - shift + right click doesn't block the shift_pressed state anymore. --- .../Scene_polyhedron_item_k_ring_selection.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h index 1453132a81e..4b8ef86fd47 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_k_ring_selection.h @@ -185,12 +185,19 @@ protected: is_active=false; } } + //to avoid the contextual menu to mess up the states. + else if(mouse_event->button() == Qt::RightButton) { + state.left_button_pressing = false; + state.shift_pressing = false; + } } - // use mouse move event for paint-like selection - if(event->type() == QEvent::MouseMove && - (state.shift_pressing && state.left_button_pressing) ) - { // paint with mouse move event + if( (event->type() == QEvent::MouseMove + || (event->type() == QEvent::MouseButtonPress + && static_cast(event)->button() == Qt::LeftButton)) + && (state.shift_pressing && state.left_button_pressing) ) + { + // paint with mouse move event QMouseEvent* mouse_event = static_cast(event); QGLViewer* viewer = *QGLViewer::QGLViewerPool().begin(); qglviewer::Camera* camera = viewer->camera();