From 270e3724a2756fcdb67584185d6041f4766e18d7 Mon Sep 17 00:00:00 2001 From: "wenjie.guo" Date: Tue, 5 Dec 2023 15:01:22 +0800 Subject: [PATCH] FIX: the preset is the same with the first one when switching printers Jira: STUDIO-5433 Signed-off-by: wenjie.guo Change-Id: Icf1979f2bcffbc9c59a072924df5073fc3eac363 --- src/libslic3r/PresetBundle.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index 6885104b9..3b630ee4d 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -1717,7 +1717,7 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) { int old_filament_count = this->filament_presets.size(); if (n > old_filament_count && old_filament_count != 0) - filament_presets.resize(n, filament_presets.front()); + filament_presets.resize(n, filament_presets.back()); else { filament_presets.resize(n); } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c3e264929..b31620417 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1465,12 +1465,10 @@ void Sidebar::on_filaments_change(size_t num_filaments) { PlaterPresetComboBox* choice/*{ nullptr }*/; init_filament_combo(&choice, i); - int last_selection = choices.back()->GetSelection(); choices.push_back(choice); // initialize selection choice->update(); - choice->SetSelection(last_selection); ++i; }