app: add support for offset buffers in gimp_channel_select_buffer() ...

... and gimp_gegl_mask_combine_buffer()

Allow the functions to work with buffers whose top-left corner is
not at (0, 0).
This commit is contained in:
Ell 2020-02-03 19:57:41 +02:00
parent 285ef0b7fc
commit 24534338e7
2 changed files with 4 additions and 3 deletions

View File

@ -455,8 +455,8 @@ gimp_channel_combine_buffer (GimpChannel *mask,
if (gimp_channel_combine_start (mask, op,
GEGL_RECTANGLE (
off_x,
off_y,
off_x + gegl_buffer_get_x (add_on_buffer),
off_y + gegl_buffer_get_y (add_on_buffer),
gegl_buffer_get_width (add_on_buffer),
gegl_buffer_get_height (add_on_buffer)),
FALSE, FALSE, &data))

View File

@ -516,7 +516,8 @@ gimp_gegl_mask_combine_buffer (GeglBuffer *mask,
if (! gegl_rectangle_intersect (&mask_rect,
GEGL_RECTANGLE (
off_x, off_y,
off_x + gegl_buffer_get_x (add_on),
off_y + gegl_buffer_get_y (add_on),
gegl_buffer_get_width (add_on),
gegl_buffer_get_height (add_on)),
gegl_buffer_get_abyss (mask)))