From 08b91d33e9eb49c3412095e5877be715be0e6845 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 26 Aug 2021 08:06:37 +0200 Subject: [PATCH] Fixed update of objects list in sidebar after deleting a part from a sinking object --- src/slic3r/GUI/GUI_ObjectList.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 23ce819dd..39676e2d7 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2730,8 +2730,9 @@ void ObjectList::delete_from_model_and_list(const std::vector& it return; m_prevent_list_events = true; - for (std::vector::const_reverse_iterator item = items_for_delete.rbegin(); item != items_for_delete.rend(); ++item) - { + + std::set modified_objects_ids; + for (std::vector::const_reverse_iterator item = items_for_delete.rbegin(); item != items_for_delete.rend(); ++item) { if (!(item->type&(itObject | itVolume | itInstance))) continue; if (item->type&itObject) { @@ -2741,8 +2742,7 @@ void ObjectList::delete_from_model_and_list(const std::vector& it else { if (!del_subobject_from_object(item->obj_idx, item->sub_obj_idx, item->type)) continue; - if (item->type&itVolume) - { + if (item->type&itVolume) { m_objects_model->Delete(m_objects_model->GetItemByVolumeId(item->obj_idx, item->sub_obj_idx)); ModelObject* obj = object(item->obj_idx); if (obj->volumes.size() == 1) { @@ -2760,7 +2760,14 @@ void ObjectList::delete_from_model_and_list(const std::vector& it else m_objects_model->Delete(m_objects_model->GetItemByInstanceId(item->obj_idx, item->sub_obj_idx)); } + + modified_objects_ids.insert(static_cast(item->obj_idx)); } + + for (size_t id : modified_objects_ids) { + update_info_items(id); + } + m_prevent_list_events = true; part_selection_changed(); }