pdb: Fix selection offset bug in Plasma

Resolves #7672

The Plasma wrapper gets the boundaries
of its filter area using gimp_item_mask_intersect().
If used on a selection, this gives the x and y
coordinates relative to the total canvas.
However, the GEGL operation will be drawn
relative to the selection - so this offsets
the effect within the selection rather than
filling the full space.
This patch fixes the problem by setting
the x and y position to 0 when there is an
active selection.
This commit is contained in:
Alx Sa 2024-03-27 10:54:39 +00:00
parent f9a4d686a5
commit e4a4063f40
2 changed files with 12 additions and 4 deletions

View file

@ -3329,11 +3329,15 @@ plug_in_plasma_invoker (GimpProcedure *procedure,
GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GeglNode *node;
gint x, y, width, height;
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GeglNode *node;
gint x, y, width, height;
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height);
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
x = y = 0;
node = gegl_node_new_child (NULL,
"operation", "gegl:plasma",
"seed", seed,

View file

@ -3353,11 +3353,15 @@ HELP
GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
GeglNode *node;
gint x, y, width, height;
GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
GeglNode *node;
gint x, y, width, height;
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height);
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
x = y = 0;
node = gegl_node_new_child (NULL,
"operation", "gegl:plasma",
"seed", seed,