Commit 42acd6ed authored by Cyrille Berger's avatar Cyrille Berger

Fix: drop of a layer below the last layer of the stack makes it appear

as the last element

BUG:166441

svn path=/trunk/koffice/; revision=1098244
parent aeb3554f
......@@ -422,13 +422,16 @@ bool KisNodeModel::dropMimeData(const QMimeData * data, Qt::DropAction action, i
} else {
parentNode = m_d->image->root();
}
dbgUI << activeNode << " " << parentNode;
if (action == Qt::CopyAction) {
dbgUI << "KisNodeModel::dropMimeData copy action on " << activeNode;
foreach(KisNode* n, nodes) {
if (row >= 0) {
emit requestAddNode(n->clone(), parentNode, parentNode->childCount() - row);
} else {
} else if (activeNode) {
emit requestAddNode(n->clone(), activeNode);
} else {
emit requestAddNode(n->clone(), parentNode, 0);
}
}
return true;
......@@ -437,8 +440,10 @@ bool KisNodeModel::dropMimeData(const QMimeData * data, Qt::DropAction action, i
foreach(KisNode* n, nodes) {
if (row >= 0) {
emit requestMoveNode(n, parentNode, parentNode->childCount() - row);
} else {
} else if (activeNode) {
emit requestMoveNode(n, activeNode);
} else {
emit requestMoveNode(n, parentNode, 0);
}
}
return true;
......
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