Commit 09d1d958 authored by Amy spark's avatar Amy spark 👉
Browse files

G'MIC: stack images when returning the list

The use of recursiveApplyNodes, introduced in
ca0d473b as part of the refactor that
enabled the rest of the input modes, missed a significant subtlety of
the layer enumeration: recursiveApplyNodes works top-down, while
G'MIC expects layers to be sorted bottom-up.

BUG: 456463
(cherry picked from commit 4555c6ee)
parent 24bd6892
Pipeline #202248 passed with stage
in 85 minutes and 18 seconds
......@@ -146,7 +146,7 @@ inputNodes(KisImageSP image, InputLayerMode inputMode, KisNodeSP currentNode)
}
case InputLayerMode::Active: {
if (isAvailable(currentNode)) {
result->append(currentNode);
result->prepend(currentNode);
}
break; // drop down in case of one more layer modes
}
......@@ -159,7 +159,7 @@ inputNodes(KisImageSP image, InputLayerMode inputMode, KisNodeSP currentNode)
auto *paintLayer =
dynamic_cast<KisPaintLayer *>(item.data());
if (paintLayer) {
r->append(item);
r->prepend(item);
}
});
return r;
......@@ -168,18 +168,18 @@ inputNodes(KisImageSP image, InputLayerMode inputMode, KisNodeSP currentNode)
}
case InputLayerMode::ActiveAndBelow: {
if (isAvailable(currentNode)) {
result->append(currentNode);
result->prepend(currentNode);
if (isAvailable(currentNode->prevSibling())) {
result->append(currentNode->prevSibling());
result->prepend(currentNode->prevSibling());
}
}
break;
}
case InputLayerMode::ActiveAndAbove: {
if (isAvailable(currentNode)) {
result->append(currentNode);
result->prepend(currentNode);
if (isAvailable(currentNode->nextSibling())) {
result->append(currentNode->nextSibling());
result->prepend(currentNode->nextSibling());
}
}
break;
......@@ -197,7 +197,7 @@ inputNodes(KisImageSP image, InputLayerMode inputMode, KisNodeSP currentNode)
dynamic_cast<KisPaintLayer *>(item.data());
if (paintLayer
&& paintLayer->visible(false) == visibility) {
r->append(item);
r->prepend(item);
}
});
return r;
......
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