mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 02:52:10 +00:00
FIX: crash when delete filament with setting support filament
jira: STUDIO-11063 Change-Id: I72ede85e540178b576239615d67017c082ded113 (cherry picked from commit bef139898a9d5f2245a7b0ae7b399c4cedcdc6a0)
This commit is contained in:
@@ -14874,11 +14874,13 @@ void Plater::on_filaments_delete(size_t num_filaments, size_t filament_id, int r
|
||||
// update global support filament
|
||||
static const char *keys[] = {"support_filament", "support_interface_filament"};
|
||||
for (auto key : keys)
|
||||
if (p->config->has(key) && p->config->opt_int(key) == filament_id + 1) {
|
||||
if (replace_filament_id == -1)
|
||||
if (p->config->has(key)) {
|
||||
if(p->config->opt_int(key) == filament_id + 1)
|
||||
(*(p->config)).erase(key);
|
||||
else
|
||||
(*(p->config)).set_key_value(key, new ConfigOptionInt(replace_filament_id + 1));
|
||||
else {
|
||||
int new_value = p->config->opt_int(key) > filament_id ? p->config->opt_int(key) - 1 : p->config->opt_int(key);
|
||||
(*(p->config)).set_key_value(key, new ConfigOptionInt(new_value));
|
||||
}
|
||||
}
|
||||
|
||||
// update object/volume/support(object and volume) filament id
|
||||
|
||||
Reference in New Issue
Block a user