keep selection when moving layers fixes #6787

This commit is contained in:
marmare314 2023-07-19 15:24:00 +02:00
parent 9aa04d90f6
commit 972fc717a6

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