Commit 80f4b3bc authored by Cyrille Berger Skott's avatar Cyrille Berger Skott
Browse files

Fix: crash when drawing on a mask with a darken enabled brush

BUG: 265362
parent 645e130f
......@@ -42,6 +42,7 @@ KoColor KisPressureDarkenOption::apply(KisPainter * painter, const KisPaintInfor
// Darken docs aren't really clear about what exactly the amount param can have as value...
quint32 darkenAmount = (qint32)(255 - 75 * computeValue(info));
KoColorTransformation* darkenTransformation = darkened.colorSpace()->createDarkenAdjustment(darkenAmount, false, 0.0);
if(!darkenTransformation) return origColor;
darkenTransformation ->transform(painter->paintColor().data(), darkened.data(), 1);
painter->setPaintColor(darkened);
delete darkenTransformation;
......@@ -55,7 +56,7 @@ void KisPressureDarkenOption::apply(KisColorSource* colorSource, const KisPaintI
quint32 darkenAmount = (qint32)(255 - 75 * computeValue(info));
KoColorTransformation* darkenTransformation = colorSource->colorSpace()->createDarkenAdjustment(darkenAmount, false, 0.0);
if(!darkenTransformation) return;
colorSource->applyColorTransformation(darkenTransformation);
delete darkenTransformation;
......
Supports Markdown
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