ObjectList: After deleting volumes from the object, update the extruder color for the object from the last and only volume

This commit is contained in:
YuSanka 2021-02-22 18:50:01 +01:00
parent 032df7f18f
commit 03dee86071

View File

@ -2487,6 +2487,13 @@ bool ObjectList::del_subobject_from_object(const int obj_idx, const int idx, con
if (!last_volume->config.empty()) { if (!last_volume->config.empty()) {
object->config.apply(last_volume->config); object->config.apply(last_volume->config);
last_volume->config.clear(); last_volume->config.clear();
// update extruder color in ObjectList
wxDataViewItem obj_item = m_objects_model->GetItemById(obj_idx);
if (obj_item) {
wxString extruder = object->config.has("extruder") ? wxString::Format("%d", object->config.extruder()) : _L("default");
m_objects_model->SetExtruder(extruder, obj_item);
}
} }
} }
} }