Commit 3602c724 authored by Agata Cacko's avatar Agata Cacko

Fix Strength not used in Rotation - Fuzzy Dab

Before this commit, if you chose Fuzzy Dab sensor
in Rotation option, the value of the Strength slider wouldn't
affect the resulting rotation of the brush tip.
This commit fixes that behaviour: now if you choose very low
Strength and the first curve from the template ones,
the brush tip will rotate only slightly (before it would rotate
within the full 360* range).

* Fuzzy Dab is 'additive' kind of sensor, so it's value would be put
in 'realAdditivePart' in rotationLikeValue(). 'constant' contains the
value of 'Strength' slider. To get it working together,
'realAdditivePart' had to be multiplied by the 'constant' value.

* HSV option just ignored the problem and multiplied it by the value of
the slider later. It couldn't be done for Rotation because Rotation
takes the canvas rotation into account (see rotationLikeValue).
Therefore it had to be done inside rotationLikeValue function, not
later. Therefore the multiplication in HSV option had to be disabled
to not double the effect.

BUG:376179
BACKPORT:krita/4.2
parent 4737bbe9
......@@ -130,7 +130,7 @@ public:
const qreal realScalingPart = hasScaling ? KisDynamicSensor::scalingToAdditive(scaling) : 0.0;
const qreal realAdditivePart = hasAdditive ? additive : 0;
qreal value = wrapInRange(2 * offset + constant * realScalingPart + realAdditivePart, -1.0, 1.0);
qreal value = wrapInRange(2 * offset + constant * (realScalingPart + realAdditivePart), -1.0, 1.0);
if (qIsNaN(value)) {
qWarning() << "rotationLikeValue returns NaN!" << normalizedBaseAngle << absoluteAxesFlipped;
value = 0;
......
......@@ -135,7 +135,6 @@ void KisPressureHSVOption::apply(KoColorTransformation* transfo, const KisPaintI
qreal v = computeSizeLikeValue(info);
if (d->parameterName == "h") {
v = computeRotationLikeValue(info, 0, false);
v = (v) * (this->value());//multiply by strength slider.
} else {
qreal halfValue = this->value()*0.5;
v = (v*this->value()) + (0.5-halfValue);
......
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