From c20e839472a084d9f71dfaa2eee59ef5afb07263 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Mon, 2 Dec 2024 09:11:44 +0800 Subject: [PATCH] ENH:support double-click switch for svg and text gizmos jira: none Change-Id: I664ee59367aedca8792de30fdf7d25b005d079e6 (cherry picked from commit 29420cc4217364df10dba3d66b2f801f7a4ac98a) --- src/slic3r/GUI/GLCanvas3D.cpp | 5 +++-- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 3c6a5cf92..04845529d 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4568,8 +4568,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // Detection of doubleclick on text to open emboss edit window auto type = m_gizmos.get_current_type(); if (evt.LeftDClick() && !m_hover_volume_idxs.empty() && - (type == GLGizmosManager::EType::Undefined //||type == GLGizmosManager::EType::Text || - //type == GLGizmosManager::EType::Svg + (type == GLGizmosManager::EType::Undefined || + type == GLGizmosManager::EType::Text || + type == GLGizmosManager::EType::Svg )) { for (int hover_volume_id : m_hover_volume_idxs) { const GLVolume &hover_gl_volume = *m_volumes.volumes[hover_volume_id]; diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index e8469ec21..7f923d748 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -956,7 +956,12 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt) m_gizmos[m_current]->on_mouse(evt); } // mouse anywhere - if (evt.Moving()) { + if (evt.LeftDClick()) { + if (m_current == Text || m_current == Svg) { + return false; + } + } + else if (evt.Moving()) { m_tooltip = update_hover_state(mouse_pos); if (m_current == MmuSegmentation || m_current == FdmSupports || m_current == Text || m_current == BrimEars || m_current == Svg) // BBS