FIX: the preset is the same with the first one when switching printers
Jira: STUDIO-5433 Signed-off-by: wenjie.guo <wenjie.guo@bambulab.com> Change-Id: Icf1979f2bcffbc9c59a072924df5073fc3eac363
This commit is contained in:
parent
b0842857ca
commit
270e3724a2
|
@ -1717,7 +1717,7 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color)
|
||||||
{
|
{
|
||||||
int old_filament_count = this->filament_presets.size();
|
int old_filament_count = this->filament_presets.size();
|
||||||
if (n > old_filament_count && old_filament_count != 0)
|
if (n > old_filament_count && old_filament_count != 0)
|
||||||
filament_presets.resize(n, filament_presets.front());
|
filament_presets.resize(n, filament_presets.back());
|
||||||
else {
|
else {
|
||||||
filament_presets.resize(n);
|
filament_presets.resize(n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1465,12 +1465,10 @@ void Sidebar::on_filaments_change(size_t num_filaments)
|
||||||
{
|
{
|
||||||
PlaterPresetComboBox* choice/*{ nullptr }*/;
|
PlaterPresetComboBox* choice/*{ nullptr }*/;
|
||||||
init_filament_combo(&choice, i);
|
init_filament_combo(&choice, i);
|
||||||
int last_selection = choices.back()->GetSelection();
|
|
||||||
choices.push_back(choice);
|
choices.push_back(choice);
|
||||||
|
|
||||||
// initialize selection
|
// initialize selection
|
||||||
choice->update();
|
choice->update();
|
||||||
choice->SetSelection(last_selection);
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue