ObjectList: Fixed a bug related to an update of selection in 3DScene.

Steps to repro:
1. Create some object with several parts.
2. Increase instances count.
3. Select some volume in ObjectList => all related volumes for each instance are selected in 3DScene (CORRECT)
4. Select last instance in ObjectList => all volumes (except one) of selected instance are selected in 3DScene (UNCORRECT).
                                         ALL volumes of selected instance have to be selected in 3DScene

Fix: To avoid lost of some volumes in selection
check non-selected volumes only if 3DScene-selection mode wasn't changed
or there is no single selection in ObjectList
This commit is contained in:
YuSanka 2021-09-09 17:15:55 +02:00
parent 3e0b7910ea
commit 9c5c9a0e78

View file

@ -3465,7 +3465,11 @@ void ObjectList::update_selections_on_canvas()
else
{
// add
volume_idxs = selection.get_unselected_volume_idxs_from(volume_idxs);
// to avoid lost of some volumes in selection
// check non-selected volumes only if selection mode wasn't changed
// OR there is no single selection
if (selection.get_mode() == mode || !single_selection)
volume_idxs = selection.get_unselected_volume_idxs_from(volume_idxs);
Plater::TakeSnapshot snapshot(wxGetApp().plater(), _(L("Selection-Add from list")));
selection.add_volumes(mode, volume_idxs, single_selection);
}