Merge pull request #6894 from Marmare314/issue-6787

keep selection when moving layers, fixes #6787
This commit is contained in:
Robert Müller 2023-07-19 13:44:33 +00:00 committed by GitHub
commit 946f792add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}
}