From f61ccaff3d0b6b091033137cd855f4045e8399e9 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Mon, 7 Apr 2025 16:42:12 +0800 Subject: [PATCH] FIX:m_max_filament_index should init to 0 jira: none Change-Id: I9a42b43ee31d27579d7624f20e49d71b4e6446b5 (cherry picked from commit c1f1b96cffb31b667e51d9a22c4ad83df5cfea26) --- src/slic3r/GUI/ObjColorDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/ObjColorDialog.cpp b/src/slic3r/GUI/ObjColorDialog.cpp index 90686ef12f..e57404326e 100644 --- a/src/slic3r/GUI/ObjColorDialog.cpp +++ b/src/slic3r/GUI/ObjColorDialog.cpp @@ -512,7 +512,7 @@ void ObjColorPanel::update_filament_ids() m_filament_ids.reserve(m_input_colors_size); for (size_t i = 0; i < m_input_colors_size; i++) { auto label = m_cluster_labels_from_algo[i]; - if (m_cluster_map_filaments[label] > 0) { + if (m_cluster_map_filaments[label] > 0) { m_filament_ids.emplace_back(m_cluster_map_filaments[label]); } else { m_filament_ids.emplace_back(1);//min filament_id is 1 @@ -677,6 +677,7 @@ void ObjColorPanel::deal_approximate_match_btn() if (m_result_icon_list.size() == 0) { return; } auto map_count = m_result_icon_list[0]->bitmap_combox->GetCount() -1; if (map_count < 1) { return; } + m_max_filament_index = 0; for (size_t i = 0; i < m_cluster_colours.size(); i++) { auto c = m_cluster_colours[i]; std::vector color_dists;