[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra/2.9] krita/plugins/paintops: Fixing HSV color options in grid and spray brushes.
From:       Wolthera van Hovell <griffinvalley () gmail ! com>
Date:       2015-03-31 21:21:35
Message-ID: E1Yd3bL-0007bb-Ft () scm ! kde ! org
[Download RAW message or body]

Git commit 0add0c08626ec0d406dd62a4b8ad149983797c1f by Wolthera van Hovell.
Committed on 31/03/2015 at 21:19.
Pushed by woltherav into branch 'calligra/2.9'.

Fixing HSV color options in grid and spray brushes.

Bonus: also fixes the HSV randomisation going crazy when the
'color per particle' option is ticked.

M  +6    -2    krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp
M  +6    -0    krita/plugins/paintops/spray/spray_brush.cpp

http://commits.kde.org/calligra/0add0c08626ec0d406dd62a4b8ad149983797c1f

diff --git a/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp \
b/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp index 9602b22..a8210d7 100644
--- a/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp
+++ b/krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp
@@ -172,9 +172,10 @@ KisSpacingInformation KisGridPaintOp::paintAt(const \
                KisPaintInformation& info)
                     params["h"] = (m_colorProperties.hue / 180.0) * drand48();
                     params["s"] = (m_colorProperties.saturation / 100.0) * \
                drand48();
                     params["v"] = (m_colorProperties.value / 100.0) * drand48();
-
                     KoColorTransformation* transfo;
                     transfo = \
m_dab->colorSpace()->createColorTransformation("hsv_adjustment", params); +           \
transfo->setParameter(3, 1);//sets the type to HSV. For some reason 0 is not an \
option. +                    transfo->setParameter(4, false);//sets the colorize to \
false.  transfo->transform(color.data(), color.data() , 1);
                 }
 
@@ -187,7 +188,6 @@ KisSpacingInformation KisGridPaintOp::paintAt(const \
KisPaintInformation& info)  if (!m_colorProperties.colorPerParticle) {
                     shouldColor = false;
                 }
-
                 m_painter->setPaintColor(color);
             }
 
@@ -219,6 +219,10 @@ KisSpacingInformation KisGridPaintOp::paintAt(const \
KisPaintInformation& info)  break;
             }
             }
+
+            if (m_colorProperties.colorPerParticle){
+                color=painter()->paintColor();//reset color//
+            }
         }
     }
 
diff --git a/krita/plugins/paintops/spray/spray_brush.cpp \
b/krita/plugins/paintops/spray/spray_brush.cpp index 9e8dfc6..94b497a 100644
--- a/krita/plugins/paintops/spray/spray_brush.cpp
+++ b/krita/plugins/paintops/spray/spray_brush.cpp
@@ -236,6 +236,8 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDeviceSP \
                source,
                 params["s"] = (m_colorProperties->saturation / 100.0) * drand48();
                 params["v"] = (m_colorProperties->value / 100.0) * drand48();
                 m_transfo->setParameters(params);
+                m_transfo->setParameter(3, 1);//sets the type to HSV. For some \
reason 0 is not an option. +                m_transfo->setParameter(4, false);//sets \
                the colorize to false.
                 m_transfo->transform(m_inkColor.data(), m_inkColor.data() , 1);
             }
 
@@ -248,6 +250,7 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDeviceSP \
source,  if (!m_colorProperties->colorPerParticle) {
                 shouldColor = false;
             }
+
             m_painter->setPaintColor(m_inkColor);
         }
 
@@ -350,6 +353,9 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDeviceSP \
source,  }
             m_painter->bltFixed(QPoint(ix, iy), m_fixedDab, m_fixedDab->bounds());
         }
+        if (m_colorProperties->colorPerParticle){
+            m_inkColor=color;//reset color//
+        }
     }
     // recover from jittering of color,
     // m_inkColor.opacity is recovered with every paint


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic