Fixed selection after layers deleting
This commit is contained in:
parent
7da9d2f66d
commit
f394f84d51
1 changed files with 12 additions and 16 deletions
|
@ -2317,32 +2317,28 @@ void ObjectList::remove()
|
||||||
wxDataViewItemArray sels;
|
wxDataViewItemArray sels;
|
||||||
GetSelections(sels);
|
GetSelections(sels);
|
||||||
|
|
||||||
|
wxDataViewItem parent = wxDataViewItem(0);
|
||||||
|
|
||||||
for (auto& item : sels)
|
for (auto& item : sels)
|
||||||
{
|
{
|
||||||
if (m_objects_model->GetParent(item) == wxDataViewItem(0))
|
if (m_objects_model->GetParent(item) == wxDataViewItem(0))
|
||||||
delete_from_model_and_list(itObject, m_objects_model->GetIdByItem(item), -1);
|
delete_from_model_and_list(itObject, m_objects_model->GetIdByItem(item), -1);
|
||||||
else {
|
else {
|
||||||
// if (sels.size() == 1)
|
if (m_objects_model->GetItemType(item) & itLayer) {
|
||||||
// select_item(m_objects_model->GetParent(item));
|
parent = m_objects_model->GetParent(item);
|
||||||
wxDataViewItem parent = m_objects_model->GetParent(item);
|
wxDataViewItemArray children;
|
||||||
if (sels.size() == 1) {
|
if (m_objects_model->GetChildren(parent, children) == 1)
|
||||||
if (!(m_objects_model->GetItemType(item) & itLayer)) {
|
parent = m_objects_model->GetTopParent(item);
|
||||||
select_item(parent);
|
|
||||||
parent = wxDataViewItem(0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
wxDataViewItemArray children;
|
|
||||||
if (m_objects_model->GetChildren(parent, children) == 1)
|
|
||||||
parent = m_objects_model->GetTopParent(item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (sels.size() == 1)
|
||||||
|
select_item(m_objects_model->GetParent(item));
|
||||||
|
|
||||||
del_subobject_item(item);
|
del_subobject_item(item);
|
||||||
|
|
||||||
if (sels.size() == 1 && parent)
|
|
||||||
select_item(parent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parent)
|
||||||
|
select_item(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::del_layer_range(const t_layer_height_range& range)
|
void ObjectList::del_layer_range(const t_layer_height_range& range)
|
||||||
|
|
Loading…
Add table
Reference in a new issue