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 Ki= sPaintInformation& info) params["h"] =3D (m_colorProperties.hue / 180.0) * dran= d48(); params["s"] =3D (m_colorProperties.saturation / 100.0)= * drand48(); params["v"] =3D (m_colorProperties.value / 100.0) * dr= and48(); - KoColorTransformation* transfo; transfo =3D m_dab->colorSpace()->createColorTransforma= tion("hsv_adjustment", params); + transfo->setParameter(3, 1);//sets the type to HSV. Fo= r 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 Kis= PaintInformation& info) if (!m_colorProperties.colorPerParticle) { shouldColor =3D false; } - m_painter->setPaintColor(color); } = @@ -219,6 +219,10 @@ KisSpacingInformation KisGridPaintOp::paintAt(const Ki= sPaintInformation& info) break; } } + + if (m_colorProperties.colorPerParticle){ + color=3Dpainter()->paintColor();//reset color// + } } } = diff --git a/krita/plugins/paintops/spray/spray_brush.cpp b/krita/plugins/p= aintops/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, KisPaintDe= viceSP source, params["s"] =3D (m_colorProperties->saturation / 100.0) * = drand48(); params["v"] =3D (m_colorProperties->value / 100.0) * drand= 48(); 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 f= alse. m_transfo->transform(m_inkColor.data(), m_inkColor.data() = , 1); } = @@ -248,6 +250,7 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDe= viceSP source, if (!m_colorProperties->colorPerParticle) { shouldColor =3D false; } + m_painter->setPaintColor(m_inkColor); } = @@ -350,6 +353,9 @@ void SprayBrush::paint(KisPaintDeviceSP dab, KisPaintDe= viceSP source, } m_painter->bltFixed(QPoint(ix, iy), m_fixedDab, m_fixedDab->bo= unds()); } + if (m_colorProperties->colorPerParticle){ + m_inkColor=3Dcolor;//reset color// + } } // recover from jittering of color, // m_inkColor.opacity is recovered with every paint