Commit 3738e293 authored by Ivan Yossi's avatar Ivan Yossi 👌

Fix regression on softness sensor on Default Circle autobrush tip

Bug:409758
parent 9f766e77
......@@ -81,9 +81,8 @@ void KisCircleMaskGenerator::setScale(qreal scaleX, qreal scaleY)
d->ycoef = 2.0 / effectiveSrcHeight();
d->xfadecoef = qFuzzyCompare(horizontalFade(), 0) ? 1 : (2.0 / (horizontalFade() * effectiveSrcWidth()));
d->yfadecoef = qFuzzyCompare(verticalFade() , 0) ? 1 : (2.0 / (verticalFade() * effectiveSrcHeight()));
d->transformedFadeX = KisMaskGenerator::softness() * d->xfadecoef;
d->transformedFadeY = KisMaskGenerator::softness() * d->yfadecoef;
d->transformedFadeX = d->xfadecoef * d->safeSoftnessCoeff;
d->transformedFadeY = d->yfadecoef * d->safeSoftnessCoeff;
}
KisCircleMaskGenerator::~KisCircleMaskGenerator()
......@@ -131,10 +130,10 @@ quint8 KisCircleMaskGenerator::valueAt(qreal x, qreal y) const
void KisCircleMaskGenerator::setSoftness(qreal softness)
{
KisMaskGenerator::setSoftness(softness);
qreal safeSoftnessCoeff = qreal(1.0) / qMax(qreal(0.01), softness);
d->safeSoftnessCoeff = qreal(1.0) / qMax(qreal(0.01), softness);
d->transformedFadeX = d->xfadecoef * safeSoftnessCoeff;
d->transformedFadeY = d->yfadecoef * safeSoftnessCoeff;
d->transformedFadeX = d->xfadecoef * d->safeSoftnessCoeff;
d->transformedFadeY = d->yfadecoef * d->safeSoftnessCoeff;
}
void KisCircleMaskGenerator::resetMaskApplicator(bool forceScalar)
......
......@@ -25,6 +25,7 @@ struct Q_DECL_HIDDEN KisCircleMaskGenerator::Private {
ycoef(0),
xfadecoef(0),
yfadecoef(0),
safeSoftnessCoeff(1.0),
transformedFadeX(0),
transformedFadeY(0),
copyOfAntialiasEdges(false)
......@@ -36,6 +37,7 @@ struct Q_DECL_HIDDEN KisCircleMaskGenerator::Private {
ycoef(rhs.ycoef),
xfadecoef(rhs.xfadecoef),
yfadecoef(rhs.yfadecoef),
safeSoftnessCoeff(rhs.safeSoftnessCoeff),
transformedFadeX(rhs.transformedFadeX),
transformedFadeY(rhs.transformedFadeY),
copyOfAntialiasEdges(rhs.copyOfAntialiasEdges)
......@@ -44,6 +46,7 @@ struct Q_DECL_HIDDEN KisCircleMaskGenerator::Private {
double xcoef, ycoef;
double xfadecoef, yfadecoef;
qreal safeSoftnessCoeff;
double transformedFadeX, transformedFadeY;
bool copyOfAntialiasEdges;
......
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