[PATCH]:merging the layer below junior job
GAURAV Agrawal
gauravagrawal03jan at gmail.com
Fri Feb 14 19:03:59 UTC 2014
Hello,
This patch is for the file calligra/krita/image/kis_image.cc.
this patch is for Bug-322951.
This patch solves the merging problem of
1)merging an alpha-disabled layer over an alpha-enabled layer
2)merging an alpha-disabled layer over an alpha-disabled layer
Please inform me if it gives any issues.
Thanks
Gaurav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20140215/da392fc5/attachment.html>
-------------- next part --------------
--- kis_image_orig.cc 2014-02-14 06:20:59.179312710 +0530
+++ kis_image.cc 2014-02-15 00:21:43.459774073 +0530
@@ -950,6 +950,7 @@ KisLayerSP KisImage::mergeDown(KisLayerS
//Copy the pixels of previous layer with their actual alpha value
prevLayer->disableAlphaChannel(false);
+
gc.setChannelFlags(prevLayer->channelFlags());
gc.setCompositeOp(mergedDevice->colorSpace()->compositeOp(prevLayer->compositeOpId()));
gc.setOpacity(prevLayer->opacity());
@@ -960,7 +961,10 @@ KisLayerSP KisImage::mergeDown(KisLayerS
prevLayer->disableAlphaChannel(prevAlphaDisabled);
//Paint the pixels of the current layer, using their actual alpha value
+ if(alphaDisabled==prevAlphaDisabled)
+ {
layer->disableAlphaChannel(false);
+ }
gc.setChannelFlags(layer->channelFlags());
gc.setCompositeOp(mergedDevice->colorSpace()->compositeOp(layer->compositeOpId()));
gc.setOpacity(layer->opacity());
@@ -978,7 +982,10 @@ KisLayerSP KisImage::mergeDown(KisLayerS
//Paint layer on the copy
KisPainter gc(mergedDevice);
+ if(alphaDisabled==prevAlphaDisabled)
+ {
layer->disableAlphaChannel(false);
+ }
gc.setChannelFlags(layer->channelFlags());
gc.setCompositeOp(mergedDevice->colorSpace()->compositeOp(layer->compositeOpId()));
gc.setOpacity(layer->opacity());
More information about the kimageshop
mailing list