mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
FIX: crash when delete filament
jira: STUDIO-9956 Change-Id: Ibef1db35c2953040bb7df6b53ed3144f3ff85d96 (cherry picked from commit 99837d8c01e782ef6634ab60a06e05f48ca31437)
This commit is contained in:
@@ -766,7 +766,7 @@ void ObjectList::update_filament_values_for_items_when_delete_filament(const siz
|
|||||||
if (replace_id >= 0)
|
if (replace_id >= 0)
|
||||||
new_extruder = replace_filament_id;
|
new_extruder = replace_filament_id;
|
||||||
extruder = wxString::Format("%d", new_extruder);
|
extruder = wxString::Format("%d", new_extruder);
|
||||||
object->config.set_key_value("extruder", new ConfigOptionInt(new_extruder));
|
object->volumes[id]->config.set_key_value("extruder", new ConfigOptionInt(new_extruder));
|
||||||
} else {
|
} else {
|
||||||
int new_extruder = object->volumes[id]->config.extruder() > filament_id ? object->volumes[id]->config.extruder() - 1 : object->volumes[id]->config.extruder();
|
int new_extruder = object->volumes[id]->config.extruder() > filament_id ? object->volumes[id]->config.extruder() - 1 : object->volumes[id]->config.extruder();
|
||||||
extruder = wxString::Format("%d", new_extruder);
|
extruder = wxString::Format("%d", new_extruder);
|
||||||
@@ -814,9 +814,6 @@ void ObjectList::update_filament_values_for_items_when_delete_filament(const siz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BBS
|
|
||||||
wxGetApp().plater()->update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2518,6 +2518,8 @@ void Sidebar::delete_filament(size_t filament_id, int replace_filament_id) {
|
|||||||
wxGetApp().plater()->on_filaments_delete(filament_count, filament_id, replace_filament_id > (int)filament_id ? (replace_filament_id - 1) : replace_filament_id);
|
wxGetApp().plater()->on_filaments_delete(filament_count, filament_id, replace_filament_id > (int)filament_id ? (replace_filament_id - 1) : replace_filament_id);
|
||||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
||||||
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
|
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
|
||||||
|
|
||||||
|
wxGetApp().plater()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sidebar::change_filament(size_t from_id, size_t to_id)
|
void Sidebar::change_filament(size_t from_id, size_t to_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user