Commit 5b39be56 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 679195 - Foreground Select Tool Mask Inverted

gimp_display_shell_render(): invert the mask so it masks what is *not*
the foreground object.
parent d1795ac2
......@@ -134,6 +134,8 @@ gimp_display_shell_render (GimpDisplayShell *shell,
if (shell->mask)
{
gint mask_height;
if (! shell->mask_surface)
{
shell->mask_surface =
......@@ -159,6 +161,23 @@ gimp_display_shell_render (GimpDisplayShell *shell,
babl_format ("Y u8"),
data, stride,
GEGL_ABYSS_NONE);
/* invert the mask so what is *not* the foreground object is masked */
mask_height = h * window_scale;
while (mask_height--)
{
gint mask_width = w * window_scale;
guchar *d = data;
while (mask_width--)
{
guchar inv = 255 - *d;
*d++ = inv;
}
data += stride;
}
}
/* put it to the screen */
......
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