From 5d6346f27508b35c58157b9fd11a684971183e73 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 21 Nov 2022 08:37:58 +0100 Subject: [PATCH] Gizmo Measure - When CTRL+dragging to pan/rotate the scene, do not select the hovered feature, if any --- src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index d85408f99..77d816aa7 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -254,6 +254,7 @@ GLGizmoMeasure::GLGizmoMeasure(GLCanvas3D& parent, const std::string& icon_filen bool GLGizmoMeasure::on_mouse(const wxMouseEvent &mouse_event) { m_mouse_pos = { double(mouse_event.GetX()), double(mouse_event.GetY()) }; + m_dragging = false; if (mouse_event.Moving()) { // only for sure @@ -261,6 +262,8 @@ bool GLGizmoMeasure::on_mouse(const wxMouseEvent &mouse_event) return false; } else if (mouse_event.Dragging()) { + m_dragging = true; + // Enable/Disable panning/rotating the 3D scene // Ctrl is pressed or the mouse is not hovering a selected volume bool unlock_dragging = mouse_event.CmdDown() || (m_hover_id == -1 && !m_parent.get_selection().contains_volume(m_parent.get_first_hover_volume_idx())); @@ -578,7 +581,9 @@ void GLGizmoMeasure::on_render() m_curr_point_on_feature_position.reset(); } else { - std::optional curr_feature = mouse_on_object ? m_measuring->get_feature(model_facet_idx, position_on_model.cast()) : std::nullopt; + std::optional curr_feature = m_dragging ? m_curr_feature : + mouse_on_object ? m_measuring->get_feature(model_facet_idx, position_on_model.cast()) : std::nullopt; + if (m_curr_feature != curr_feature || (curr_feature.has_value() && curr_feature->get_type() == Measure::SurfaceFeatureType::Circle && (m_curr_feature != curr_feature || m_last_inv_zoom != inv_zoom))) { m_parent.remove_raycasters_for_picking(SceneRaycaster::EType::Gizmo, POINT_ID);