Bug 791519 - Unexpected selection from channel

One additional fix for the gimp-channel-combine-masks procedure,
it needs both the combined *and* combined-to buffer in
gimp_gegl_mask_combine_buffer() to be treated specially.
This commit is contained in:
Michael Natterer 2018-04-08 20:26:32 +02:00
parent bb4ac7c829
commit 8994246be2
1 changed files with 11 additions and 1 deletions

View File

@ -377,6 +377,7 @@ gimp_gegl_mask_combine_buffer (GeglBuffer *mask,
{
GeglBufferIterator *iter;
GeglRectangle rect;
const Babl *mask_format;
const Babl *add_on_format;
gint x, y, w, h;
@ -397,8 +398,17 @@ gimp_gegl_mask_combine_buffer (GeglBuffer *mask,
rect.width = w;
rect.height = h;
/* See below: this additional hack is only needed for the
* gimp-channel-combine-masks procedure, it's the only place that
* allows to combine arbitrary channels with each other.
*/
if (gimp_babl_format_get_linear (gegl_buffer_get_format (mask)))
mask_format = babl_format ("Y float");
else
mask_format = babl_format ("Y' float");
iter = gegl_buffer_iterator_new (mask, &rect, 0,
babl_format ("Y float"),
mask_format,
GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
rect.x -= off_x;