FIX: Support raft interface lost when filament removed

Jira: STUDIO-13777
Change-Id: I500bfb558e6739a79c679afad10e8be121a49ec2
(cherry picked from commit c9cf0843d2ecb3d2c549e2282a922b8fa4ae9ddc)
This commit is contained in:
weiting.ji
2025-08-04 16:32:36 +08:00
committed by Noisyfox
parent 0581fac6e6
commit bb4944e955
2 changed files with 16 additions and 4 deletions

View File

@@ -457,7 +457,12 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
if (opt != nullptr) {
if (opt->getInt() > filament_cnt) {
DynamicPrintConfig new_conf = *config;
new_conf.set_key_value(key, new ConfigOptionInt(0));
const DynamicPrintConfig *conf_temp = wxGetApp().plater()->config();
int new_value = 0;
if (conf_temp != nullptr && conf_temp->has(key)) {
new_value = conf_temp->opt_int(key);
}
new_conf.set_key_value(key, new ConfigOptionInt(new_value));
apply(config, &new_conf);
}
}