From 97541e204341bd29912e2746e6f335699f0c7ad9 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Thu, 7 Mar 2024 11:24:01 +0800 Subject: [PATCH] FIX:fix text display in measure gizmo fix right up then exit gizmo Jira: STUDIO-6426 STUDIO-6427 STUDIO-6417 Change-Id: Ifc8ed5d47d0134fe9545db619aec1d0e32c16775 --- src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp | 7 ++++++- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 7 ++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 0f4d1c8d2..1f689b10f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -575,7 +575,11 @@ void GLGizmoMeasure::on_set_state() std::string GLGizmoMeasure::on_get_name() const { - return _u8L("Measure"); + if (!on_is_activable() && m_state == EState::Off) { + return _u8L("Measure") + ":\n" + _u8L("Please select at least one object."); + } else { + return _u8L("Measure"); + } } bool GLGizmoMeasure::on_is_activable() const @@ -1987,6 +1991,7 @@ void GLGizmoMeasure::on_render_input_window(float x, float y, float bottom_limit ImGui::PushItemWidth(feature_second_text_length); m_imgui->text(feature_second_text); if (m_selected_features.first.feature.has_value() && m_selected_features.second.feature.has_value()) { + m_show_reset_first_tip = false; ImGui::SameLine(selection_cap_length + feature_second_text_length + space_size * 2); ImGui::PushItemWidth(space_size * 2); ImGui::PushID("Reset2"); diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index f4fbb0f7d..ab9c698dd 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -1011,9 +1011,10 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt) //wxGetApp().obj_manipul()->set_dirty(); processed = true; } - else if (evt.RightUp() && (m_current == FdmSupports || m_current == Seam || m_current == MmuSegmentation || m_current == Cut) - && !m_parent.is_mouse_dragging() - && gizmo_event(SLAGizmoEventType::RightUp, mouse_pos, evt.ShiftDown(), evt.AltDown(), control_down)) { + else if (evt.RightUp() && (m_current == FdmSupports || m_current == Seam || m_current == MmuSegmentation || m_current == Cut + || m_current == Measure || m_current == MeshBoolean) + && !m_parent.is_mouse_dragging() ) { + gizmo_event(SLAGizmoEventType::RightUp, mouse_pos, evt.ShiftDown(), evt.AltDown(), control_down); processed = true; } else if (evt.LeftUp()) {