mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #6894 from Marmare314/issue-6787
keep selection when moving layers, fixes #6787
This commit is contained in:
commit
946f792add
|
@ -3978,11 +3978,15 @@ void CEditor::RenderLayers(CUIRect LayersBox)
|
|||
}
|
||||
|
||||
auto InsertPosition = std::find(vpNewGroupLayers.begin(), vpNewGroupLayers.end(), pNextLayer);
|
||||
int InsertPositionIndex = InsertPosition - vpNewGroupLayers.begin();
|
||||
vpNewGroupLayers.insert(InsertPosition, vpSelectedLayers.begin(), vpSelectedLayers.end());
|
||||
|
||||
m_SelectedGroup = GroupAfterDraggedLayer - 1;
|
||||
int NumSelectedLayers = m_vSelectedLayers.size();
|
||||
m_vSelectedLayers.clear();
|
||||
m_vSelectedQuads.clear();
|
||||
for(int i = 0; i < NumSelectedLayers; i++)
|
||||
m_vSelectedLayers.push_back(InsertPositionIndex + i);
|
||||
|
||||
m_SelectedGroup = GroupAfterDraggedLayer - 1;
|
||||
m_Map.OnModify();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue