From b59ff2c2948f33ba0afaa9ff9b731e2109f40210 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 9 Jun 2021 17:21:39 +0200 Subject: [PATCH] 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 --- src/slic3r/GUI/GUI_ObjectList.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 9ec17fb48..53fbc4c1c 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -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);