Commit a2f1b0cb authored by Eoin O'Neill's avatar Eoin O'Neill 🍀
Browse files

Fixed Merge Multiple 'putAfter' Bug Causing Wrong Layers To Merge

Fixed bug where invalid putAfter was causing incorrect nodes to merge when
lowest most 'active' node was invisible.

BUG: 395903
parent 9e3941f7
......@@ -1246,6 +1246,14 @@ namespace KisLayerUtils {
mergedNodes = filterInvisibleNodes(originalNodes, &invisibleNodes, &putAfter);
if (!invisibleNodes.isEmpty()) {
/* If the putAfter node is invisible,
* we should instead pick one of the nodes
* to be merged to avoid a null putAfter.
if (!putAfter->visible()){
putAfter = mergedNodes.first();
new SimpleRemoveLayers(invisibleNodes,
......@@ -1296,6 +1304,7 @@ namespace KisLayerUtils {
applicator.applyCommand(new KeepMergedNodesSelected(info, putAfter, true));
Supports Markdown
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