From 049d4ba335a019379a52168664a8e68196d4d054 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 26 Apr 2019 14:07:05 +0200 Subject: [PATCH] Another synch with branch et_selection_rectangle --- src/slic3r/GUI/GLCanvas3D.cpp | 12 +++++++++++- src/slic3r/GUI/GLCanvas3D.hpp | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index f4b6a2b99..985f7ded2 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -675,6 +675,7 @@ GLCanvas3D::Mouse::Mouse() : dragging(false) , position(DBL_MAX, DBL_MAX) , scene_position(DBL_MAX, DBL_MAX, DBL_MAX) + , ignore_left_up(false) { } @@ -2387,6 +2388,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) { _update_selection_from_hover(); m_rectangle_selection.stop_dragging(); + m_mouse.ignore_left_up = true; m_dirty = true; } set_cursor(Standard); @@ -2397,6 +2399,7 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) { _update_selection_from_hover(); m_rectangle_selection.stop_dragging(); + m_mouse.ignore_left_up = true; m_dirty = true; } set_cursor(Standard); @@ -2409,12 +2412,18 @@ void GLCanvas3D::on_key(wxKeyEvent& evt) if (keyCode == WXK_SHIFT) { if (m_picking_enabled && (m_gizmos.get_current_type() != GLGizmosManager::SlaSupports)) + { + m_mouse.ignore_left_up = false; set_cursor(Cross); + } } else if (keyCode == WXK_ALT) { if (m_picking_enabled && (m_gizmos.get_current_type() != GLGizmosManager::SlaSupports)) + { + m_mouse.ignore_left_up = false; set_cursor(Cross); + } } else if (keyCode == WXK_CONTROL) m_dirty = true; @@ -2536,6 +2545,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_mouse.set_start_position_3D_as_invalid(); m_mouse.set_start_position_2D_as_invalid(); m_mouse.dragging = false; + m_mouse.ignore_left_up = false; m_dirty = true; if (m_canvas->HasCapture()) @@ -2857,7 +2867,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_rectangle_selection.stop_dragging(); } - else if (evt.LeftUp() && !m_mouse.dragging && m_hover_volume_idxs.empty() && !is_layers_editing_enabled()) + else if (evt.LeftUp() && !m_mouse.ignore_left_up && !m_mouse.dragging && m_hover_volume_idxs.empty() && !is_layers_editing_enabled()) { // deselect and propagate event through callback if (!evt.ShiftDown() && m_picking_enabled) diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 4d2c0c2b2..4670b7221 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -303,6 +303,7 @@ class GLCanvas3D Vec2d position; Vec3d scene_position; Drag drag; + bool ignore_left_up; Mouse();