We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4354fc commit fe6b62bCopy full SHA for fe6b62b
src/tiled/mapdocument.cpp
@@ -470,7 +470,8 @@ Layer *MapDocument::addLayer(Layer::TypeFlag layerType)
470
}
471
Q_ASSERT(layer);
472
473
- const int index = mMap->layerCount();
+ const int index = mCurrentLayerIndex >= 0 ? mCurrentLayerIndex + 1
474
+ : mMap->layerCount();
475
mUndoStack->push(new AddLayer(this, index, layer));
476
setCurrentLayerIndex(index);
477
0 commit comments