From 8bafed6e0a0ac7237077e7e0a964706e35e5ed12 Mon Sep 17 00:00:00 2001 From: mack-test Date: Fri, 10 Jan 2025 16:32:29 +0800 Subject: [PATCH] Fix:on Mac,step mesh shows a count of 0 initially jira: STUDIO-9595 Change-Id: I9908d3eff394ada12dd9ab0a2c10ca8a78d4f1f6 --- src/slic3r/GUI/StepMeshDialog.cpp | 10 +++++----- src/slic3r/GUI/StepMeshDialog.hpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/StepMeshDialog.cpp b/src/slic3r/GUI/StepMeshDialog.cpp index 5035bf51d..c29151d7a 100644 --- a/src/slic3r/GUI/StepMeshDialog.cpp +++ b/src/slic3r/GUI/StepMeshDialog.cpp @@ -344,22 +344,22 @@ void StepMeshDialog::stop_task() void StepMeshDialog::update_mesh_number_text() { - if (m_last_linear == get_linear_defletion() && m_last_angle == get_angle_defletion()) + if ((m_last_linear == get_linear_defletion()) && (m_last_angle == get_angle_defletion()) && (m_mesh_number != 0)) return; wxString newText = wxString::Format(_L("Calculating, please wait...")); mesh_face_number_text->SetLabel(newText); stop_task(); task = std::async(std::launch::async, [&] { - unsigned int number = m_file.get_triangle_num(get_linear_defletion(), get_angle_defletion()); - if (number != 0) { - wxString number_text = wxString::Format("%d", number); + unsigned int m_mesh_number = m_file.get_triangle_num(get_linear_defletion(), get_angle_defletion()); + if (m_mesh_number != 0) { + wxString number_text = wxString::Format("%d", m_mesh_number); wxCommandEvent event(wxEVT_THREAD_DONE); event.SetString(number_text); wxPostEvent(this, event); m_last_linear = get_linear_defletion(); m_last_angle = get_angle_defletion(); } - return number; + return m_mesh_number; }); } \ No newline at end of file diff --git a/src/slic3r/GUI/StepMeshDialog.hpp b/src/slic3r/GUI/StepMeshDialog.hpp index 1ed0a7384..65c2fed86 100644 --- a/src/slic3r/GUI/StepMeshDialog.hpp +++ b/src/slic3r/GUI/StepMeshDialog.hpp @@ -44,6 +44,7 @@ private: wxStaticText* mesh_face_number_text; double m_last_linear = 0.003; double m_last_angle = 0.5; + unsigned int m_mesh_number = 0; std::future task; bool validate_number_range(const wxString& value, double min, double max); void update_mesh_number_text();