Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c6d00e8f authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix conversion of masks into a paint layer

We should also convert the default pixel and blending mode
parent 96157f51
......@@ -102,6 +102,7 @@
#include "kis_layer_utils.h"
#include "lazybrush/kis_colorize_mask.h"
#include "kis_processing_applicator.h"
#include "kis_projection_leaf.h"
#include "KisSaveGroupVisitor.h"
......@@ -387,7 +388,11 @@ void KisLayerManager::convertNodeToPaintLayer(KisNodeSP source)
source->paintDevice() ? source->projection() : source->original();
bool putBehind = false;
QString newCompositeOp = source->compositeOpId();
QString newCompositeOp =
source->projectionLeaf()->isLayer() ?
source->compositeOpId() : COMPOSITE_OVER;
KisColorizeMask *colorizeMask = dynamic_cast<KisColorizeMask*>(source.data());
if (colorizeMask) {
srcDevice = colorizeMask->coloringProjection();
......@@ -405,6 +410,9 @@ void KisLayerManager::convertNodeToPaintLayer(KisNodeSP source)
*srcDevice->compositionSourceColorSpace()) {
clone = new KisPaintDevice(srcDevice->compositionSourceColorSpace());
clone->setDefaultPixel(
srcDevice->defaultPixel().convertedTo(
srcDevice->compositionSourceColorSpace()));
QRect rc(srcDevice->extent());
KisPainter::copyAreaOptimized(rc.topLeft(), srcDevice, clone, rc);
......
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