Skip to content

Commit

Permalink
When adding a new layer, insert it above the current one
Browse files Browse the repository at this point in the history
It is usually more useful for the layer to be inserted above the current
layer, rather than always at the top of the stack.
  • Loading branch information
bjorn committed Jan 17, 2017
1 parent f4354fc commit fe6b62b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tiled/mapdocument.cpp
Expand Up @@ -470,7 +470,8 @@ Layer *MapDocument::addLayer(Layer::TypeFlag layerType)
}
Q_ASSERT(layer);

const int index = mMap->layerCount();
const int index = mCurrentLayerIndex >= 0 ? mCurrentLayerIndex + 1
: mMap->layerCount();
mUndoStack->push(new AddLayer(this, index, layer));
setCurrentLayerIndex(index);

Expand Down

0 comments on commit fe6b62b

Please sign in to comment.