Commit 2cfe3745 authored by Eoin O'Neill's avatar Eoin O'Neill 🍀

Allow 'Add Clone Layer' to Work on Multiple Layers

This is a bugfix which allows multiple layers to be cloned simultaneously.

Bug:373338
parent b1453b9d
...@@ -627,9 +627,15 @@ KisNodeSP KisLayerManager::addGroupLayer(KisNodeSP activeNode) ...@@ -627,9 +627,15 @@ KisNodeSP KisLayerManager::addGroupLayer(KisNodeSP activeNode)
KisNodeSP KisLayerManager::addCloneLayer(KisNodeSP activeNode) KisNodeSP KisLayerManager::addCloneLayer(KisNodeSP activeNode)
{ {
KisImageWSP image = m_view->image(); KisImageWSP image = m_view->image();
KisNodeSP node = new KisCloneLayer(activeLayer(), image.data(), image->nextLayerName(), OPACITY_OPAQUE_U8); KisNodeList selection = m_view->nodeManager()->selectedNodes();
addLayerCommon(activeNode, node, true, 0);
return node; KisNodeSP node, clonedNode;
Q_FOREACH (node, selection) {
KisNodeSP clonedNode = new KisCloneLayer(qobject_cast<KisLayer*>(node.data()), image.data(), image->nextLayerName(), OPACITY_OPAQUE_U8);
addLayerCommon(activeNode, clonedNode, true, 0 );
}
return clonedNode;
} }
KisNodeSP KisLayerManager::addShapeLayer(KisNodeSP activeNode) KisNodeSP KisLayerManager::addShapeLayer(KisNodeSP activeNode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment