Commit 59d8e622 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Add a comment about merging adjustment layers

Krita sticks to "keep image unchanged" approach when merging layers,
just state it clearly in the code, so we wouldn't spend time on
discussing that again.

parent a2a1b600
......@@ -46,6 +46,9 @@ KisAdjustmentLayer::KisAdjustmentLayer(KisImageWSP image,
// demand the opposite from each other...
// also see a comment in KisLayerUtils::mergeMultipleLayersImpl()
......@@ -933,6 +933,9 @@ namespace KisLayerUtils {
* \see a comment in mergeMultipleLayersImpl()
void mergeDown(KisImageSP image, KisLayerSP layer, const KisMetaData::MergeStrategy* strategy)
if (!layer->prevSibling()) return;
......@@ -1257,6 +1260,31 @@ namespace KisLayerUtils {
* There might be two approaches for merging multiple layers:
* 1) Consider the selected nodes as a distinct "group" and merge them
* as if they were isolated from the rest of the image. The key point
* of this approach is that the look of the image will change, when
* merging "weird" layers, like adjustment layers or layers with
* non-normal blending mode.
* 2) Merge layers in a way to keep the look of the image as unchanged as
* possible. With this approach one uses a few heuristics:
* * when merging multiple layers with non-normal (but equal) blending
* mode, first merge these layers together using Normal blending mode,
* then set blending mode of the result to the original blending mode
* * when merging multiple layers with different blending modes or
* layer styles, they are first rasterized, and then laid over each
* other with their own composite op. The blending mode of the final
* layer is set to Normal, so the user could clearly see that he should
* choose the correct blending mode.
* Krita uses the second approach: after merge operation, the image should look
* as if nothing has happened (if it is technically possible).
void mergeMultipleLayersImpl(KisImageSP image, KisNodeList mergedNodes, KisNodeSP putAfter,
bool flattenSingleLayer, const KUndo2MagicString &actionName,
bool cleanupNodes = true, const QString layerName = QString())
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