[PATCH 04/10] Fixed some gliches introducing transparency and black color where it should not be.

Silvio Heinrich plassy at web.de
Mon Jan 3 21:34:41 CET 2011


---
 .../defaultpaintops/smudge/kis_smudgeop.cpp        |    6 +++---
 libs/pigment/compositeops/KoCompositeOpCopyOpacy.h |    7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp b/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp
index 0dabf9a..ef48e1f 100644
--- a/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp
+++ b/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp
@@ -87,7 +87,7 @@ qreal KisSmudgeOp::paintAt(const KisPaintInformation& info)
     QPointF point = info.pos() - brush->hotSpot(scale, scale);
     
     qint32 x, y;
-    qreal xFraction, yFraction;
+    qreal xFraction, yFraction; // will not be used
     splitCoordinate(point.x(), &x, &xFraction);
     splitCoordinate(point.y(), &y, &yFraction);
     
@@ -96,11 +96,11 @@ qreal KisSmudgeOp::paintAt(const KisPaintInformation& info)
     // Extract the brush mask (maskDab) from brush with the correct scaled size
     if(brush->brushType() == IMAGE || brush->brushType() == PIPE_IMAGE) {
         // This is for bitmap brushes
-        maskDab = brush->paintDevice(painter()->device()->colorSpace(), scale, 0.0, info, xFraction, yFraction);
+        maskDab = brush->paintDevice(painter()->device()->colorSpace(), scale, 0.0, info, 0.0, 0.0);
     } else {
         // This is for parametric brushes, those created in the Autobrush popup config dialogue
         maskDab = cachedDab();
-        brush->mask(maskDab, painter()->paintColor(), scale, scale, 0.0, info, xFraction, yFraction);
+        brush->mask(maskDab, painter()->paintColor(), scale, scale, 0.0, info, 0.0, 0.0);
     }
     
     // transforms the fixed paint device with the current brush to alpha color space (to use it as alpha/transparency mask)
diff --git a/libs/pigment/compositeops/KoCompositeOpCopyOpacy.h b/libs/pigment/compositeops/KoCompositeOpCopyOpacy.h
index 97dcbfd..48f63ce 100644
--- a/libs/pigment/compositeops/KoCompositeOpCopyOpacy.h
+++ b/libs/pigment/compositeops/KoCompositeOpCopyOpacy.h
@@ -78,14 +78,13 @@ public:
                     if(useMask) {
                         channels_type blend = KoColorSpaceMaths<quint8,channels_type>::scaleToA(*mskRowItr);
                         value = KoColorSpaceMaths<channels_type>::blend(value, *dstRowItr, blend);
-                        value = (value > *dstRowItr) ? (value-1) : value;
                         ++mskRowItr;
                     }
                     
+                    value      = (value > *dstRowItr) ? (value-1) : value;
                     *dstRowItr = value;
                     srcRowItr += channels_nb;
                     dstRowItr += channels_nb;
-                    
                 }
                 
                 srcRowStart  += srcRowStride;
@@ -113,10 +112,10 @@ public:
                     if(useMask) {
                         channels_type blend = KoColorSpaceMaths<quint8,channels_type>::scaleToA(*mskRowItr);
                         value = KoColorSpaceMaths<channels_type>::blend(value, *dstRowItr, blend);
-                        value = (value > *dstRowItr) ? (value-1) : value;
                         ++mskRowItr;
                     }
                     
+                    value      = (value > *dstRowItr) ? (value-1) : value;
                     *dstRowItr = value;
                     dstRowItr += channels_nb;
                 }
@@ -127,7 +126,7 @@ public:
             }
         }
     }
-                                            
+    
 };
 
 #endif // KOCOMPOSITEOPCOPYOPACY_H_
-- 
1.7.1




More information about the kimageshop mailing list