Fix for SPE-1686 : Bug with instance rotation around X or Y

Steps to repro:
1. Add object
2. Increase instances
3. Select some instance
4. Rotate around X or Y
5. After MouseUp:
OSX -> hard crash
MSW and Linux -> object and instance are selected at a same time
This commit is contained in:
YuSanka 2023-05-03 14:26:06 +02:00
parent 49fbf4ccce
commit 234956dfda
2 changed files with 36 additions and 18 deletions
src/slic3r/GUI

View file

@ -2994,21 +2994,19 @@ void ObjectList::update_info_items(size_t obj_idx, wxDataViewItemArray* selectio
wxGetApp().notification_manager()->push_updated_item_info_notification(type);
}
else if (shows && ! should_show) {
if (!selections)
if (!selections && IsSelected(item)) {
Unselect(item);
m_objects_model->Delete(item);
if (selections) {
if (selections->Index(item) != wxNOT_FOUND) {
// If info item was deleted from the list,
// it's need to be deleted from selection array, if it was there
selections->Remove(item);
// Select item_obj, if info_item doesn't exist for item anymore, but was selected
if (selections->Index(item_obj) == wxNOT_FOUND)
selections->Add(item_obj);
}
}
else
Select(item_obj);
}
m_objects_model->Delete(item);
if (selections && selections->Index(item) != wxNOT_FOUND) {
// If info item was deleted from the list,
// it's need to be deleted from selection array, if it was there
selections->Remove(item);
// Select item_obj, if info_item doesn't exist for item anymore, but was selected
if (selections->Index(item_obj) == wxNOT_FOUND)
selections->Add(item_obj);
}
}
}
}