Fixed a bug in update of the ObjectList when switching between 3d-View and Preview

Steps to repro:
1. start PrusaSlicer
2. add a box
-> watch the object list: only one item is shown in the list
3. switch to preview
-> the item in the object list gets a child
This commit is contained in:
YuSanka 2021-06-09 17:21:39 +02:00
parent 5631b2cb7c
commit b59ff2c294

View file

@ -3886,6 +3886,9 @@ wxDataViewItemArray ObjectList::reorder_volumes_and_get_selection(int obj_idx, s
wxDataViewItemArray items;
ModelObject* object = (*m_objects)[obj_idx];
if (object->volumes.size() <= 1)
return items;
object->sort_volumes(wxGetApp().app_config->get("order_volumes") == "1");
wxDataViewItem object_item = m_objects_model->GetItemById(obj_idx);