From 728042958372a8bea3a42118e30baf8ee566a49c Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Mon, 22 Jul 2024 12:20:04 +0800 Subject: [PATCH] FIX: filament filter dirty options Change-Id: I00e0df4c2f9dc43f12b38e52c87a353b3f3e38fd Jira: STUDIO-7643 --- src/slic3r/GUI/Tab.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index f943700f0..21f217a7c 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -844,7 +844,8 @@ void Tab::decorate() void Tab::filter_diff_option(std::vector &options) { for (auto &opt : options) { - if (opt.find_last_of('#') == std::string::npos) continue; + auto n = opt.find_last_of('#'); + if (n == std::string::npos) continue; bool found = false; for (auto page : m_pages) { if (auto iter = page->m_opt_id_map.find(opt); iter != page->m_opt_id_map.end()) { @@ -853,7 +854,7 @@ void Tab::filter_diff_option(std::vector &options) break; } } - if (!found) opt.clear(); + if (!found) opt = opt.substr(0, n); } options.erase(std::remove(options.begin(), options.end(), ""), options.end()); } @@ -878,10 +879,8 @@ void Tab::update_changed_ui() update_custom_dirty(dirty_options, nonsys_options); - if (m_extruder_switch == nullptr || m_extruder_switch->IsEnabled()) { - filter_diff_option(dirty_options); - filter_diff_option(nonsys_options); - } + filter_diff_option(dirty_options); + filter_diff_option(nonsys_options); for (auto& it : m_options_list) it.second = m_opt_status_value;