diff --git a/src/DrawingProgram/DrawingProgramSelection.cpp b/src/DrawingProgram/DrawingProgramSelection.cpp index d35bd75..a348e4b 100644 --- a/src/DrawingProgram/DrawingProgramSelection.cpp +++ b/src/DrawingProgram/DrawingProgramSelection.cpp @@ -110,7 +110,7 @@ void DrawingProgramSelection::sort_selection() { std::vector flattenedLayerList = drawP.layerMan.get_flattened_layer_list(); std::unordered_map flattenedLayerListOrder; for(size_t i = 0; i < flattenedLayerList.size(); i++) - flattenedLayerListOrder[flattenedLayerList[i]] = i; + flattenedLayerListOrder[flattenedLayerList[i]] = flattenedLayerList.size() - 1 - i; std::sort(selectedSet.begin(), selectedSet.end(), [&](auto& a, auto& b) { return (flattenedLayerListOrder[a->obj->parentLayer] < flattenedLayerListOrder[b->obj->parentLayer]) || (a->obj->parentLayer == b->obj->parentLayer && a->pos < b->pos); });