Fixed DnD for "Model part" volumes inside the object
Fixed volumes order inside the object
This commit is contained in:
parent
2d9953069a
commit
7eebd56b5f
7 changed files with 101 additions and 96 deletions
src/slic3r/GUI
|
@ -368,25 +368,7 @@ wxDataViewItem ObjectDataViewModel::AddVolumeChild( const wxDataViewItem &parent
|
|||
if (insert_position >= 0) insert_position++;
|
||||
}
|
||||
|
||||
size_t new_volume_id = root->m_volumes_cnt;
|
||||
|
||||
// find insert_position in respect to the volume type
|
||||
for (int pos = (insert_position < 0 ? (int)root->GetChildCount() : insert_position) - 1; pos >= 0; pos--) {
|
||||
ObjectDataViewModelNode* node = root->GetNthChild(pos);
|
||||
if (volume_type >= node->m_volume_type) {
|
||||
insert_position = pos + 1;
|
||||
new_volume_id = (size_t)(node->GetIdx()) + 1;
|
||||
for (int new_pos = pos + 1; new_pos < (int)root->GetChildCount(); new_pos++) {
|
||||
ObjectDataViewModelNode* new_node = root->GetNthChild(new_pos);
|
||||
if (new_node->GetType() != itVolume)
|
||||
break;
|
||||
new_node->SetIdx(new_node->GetIdx() + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const auto node = new ObjectDataViewModelNode(root, name, volume_type, GetVolumeIcon(volume_type, has_errors), extruder_str, new_volume_id);
|
||||
const auto node = new ObjectDataViewModelNode(root, name, volume_type, GetVolumeIcon(volume_type, has_errors), extruder_str, root->m_volumes_cnt);
|
||||
insert_position < 0 ? root->Append(node) : root->Insert(node, insert_position);
|
||||
|
||||
// if part with errors is added, but object wasn't marked, then mark it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue