Issue #4354 - When using color to fade dynamics and gradient with transparency ...

... brush does not have transparency

In the PAINT_MASK_TO_COMP_MASK paintcore-loops algorithm, used when
painting incrementally, multiply the paint mask values by the paint
opacity.  Previously, the paint opacity was ignored, breaking
various dynamics affecting the opacity.
This commit is contained in:
Ell 2020-01-09 22:26:35 +02:00
parent 4a59c8919d
commit 9fe33702fb
1 changed files with 8 additions and 3 deletions

View File

@ -1725,7 +1725,8 @@ struct PaintMaskToCompMask : Base
for (x = 0; x < rect->width; x++)
{
comp_mask_pixel[0] = value_to_float (mask_pixel[0]) *
state->mask_pixel[0];
state->mask_pixel[0] *
params->paint_opacity;
comp_mask_pixel += 1;
mask_pixel += 1;
@ -1736,7 +1737,8 @@ struct PaintMaskToCompMask : Base
{
for (x = 0; x < rect->width; x++)
{
comp_mask_pixel[0] = value_to_float (mask_pixel[0]);
comp_mask_pixel[0] = value_to_float (mask_pixel[0]) *
params->paint_opacity;
comp_mask_pixel += 1;
mask_pixel += 1;
@ -1843,7 +1845,10 @@ struct DispatchPaintMaskToCompMask
{
using NewAlgorithm = typename decltype (algorithm)::type;
Dispatch<NewAlgorithm> () (visitor, params, algorithms, algorithm);
if (params->paint_opacity == GIMP_OPACITY_OPAQUE)
Dispatch<NewAlgorithm> () (visitor, params, algorithms, algorithm);
else
DispatchIndirect () (visitor, params, algorithms, algorithm);
},
params, algorithms, algorithm,
dispatch_paint_mask,