Commit d5494d3f authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Fix the color effect sliders now I'm not dead tired.

parent 15704dfc
......@@ -47,10 +47,10 @@ KisWdgMultigridPattern::KisWdgMultigridPattern(QWidget* parent, const KoColorSpa
widget()->sldColorRatio->setRange(-2.0, 2.0, 2);
widget()->sldColorRatio->setPrefix(i18n("Ratio:"));
widget()->sldColorIndex->setRange(-1.0, 1.0, 2);
widget()->sldColorIndex->setRange(-2.0, 2.0, 2);
widget()->sldColorIndex->setPrefix(i18n("Index:"));
widget()->sldColorIntersect->setRange(0.0, 1.0, 2);
widget()->sldColorIntersect->setRange(-2.0, 2.0, 2);
widget()->sldColorIntersect->setPrefix(i18n("Intersect:"));
connect(m_widget->bnColor1, SIGNAL(changed(const KoColor&)), this, SIGNAL(sigConfigurationUpdated()));
......
......@@ -188,16 +188,21 @@ void KisMultigridPatternGenerator::generate(KisProcessingInformation dstInfo,
qreal intersectRatio = qreal(rhomb.line1)/qreal(dimensions);
intersectRatio += qreal(rhomb.line2)/qreal(dimensions);
intersectRatio *= 0.5;
qreal indexRatio = 1-abs(qreal(rhomb.parallel1)/qreal(divisions/2.0));
indexRatio *= 1-abs(qreal(rhomb.parallel2)/qreal(divisions/2.0));
if (colorRatio>=0) {
gradientPos *= (shapeRatio*colorRatio);
gradientPos *= 1-(shapeRatio*colorRatio);
} else {
gradientPos *= 1-(shapeRatio*abs(colorRatio));
gradientPos *= 1-((1-shapeRatio)*abs(colorRatio));
}
if (colorIntersect>=0) {
gradientPos *= 1-(intersectRatio*colorIntersect);
} else {
gradientPos *= 1-((1-intersectRatio)*abs(colorIntersect));
}
gradientPos *= 1-(intersectRatio*colorIntersect);
if (colorIndex>=0) {
gradientPos *= 1-(indexRatio*colorIndex);
} else {
......
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