app: review and fix previous commit.

* Do not force-clip effects with a mask. Otherwise when adding a filter,
  it initially renders fine (and can cross its input extents), but once
  applied, it's suddenly clipped. That's not what we want.
* Fix gimp_filter_stack_get_bounding_box() computation.
* Fix the crop_before area when there was a selection. We have in fact
  to start at 0×0 on input and only use width×height dimensions.
This commit is contained in:
Jehan 2024-10-07 19:15:30 +02:00
parent 59b7b6a5fb
commit d41660136e
2 changed files with 6 additions and 14 deletions

View file

@ -988,14 +988,6 @@ gimp_drawable_filter_sync_clip (GimpDrawableFilter *filter,
else else
clip = gimp_item_get_clip (GIMP_ITEM (filter->drawable), filter->clip); clip = gimp_item_get_clip (GIMP_ITEM (filter->drawable), filter->clip);
if (! clip)
{
GimpChannel *mask = GIMP_CHANNEL (filter->mask);
if (mask && ! gimp_channel_is_empty (mask))
clip = TRUE;
}
if (! clip) if (! clip)
{ {
GeglRectangle bounding_box; GeglRectangle bounding_box;
@ -1040,8 +1032,8 @@ gimp_drawable_filter_sync_region (GimpDrawableFilter *filter)
NULL); NULL);
gegl_node_set (filter->crop_before, gegl_node_set (filter->crop_before,
"x", (gdouble) rect.x, "x", 0.0,
"y", (gdouble) rect.y, "y", 0.0,
"width", (gdouble) rect.width, "width", (gdouble) rect.width,
"height", (gdouble) rect.height, "height", (gdouble) rect.height,
NULL); NULL);

View file

@ -248,11 +248,11 @@ gimp_filter_stack_get_bounding_box (GimpFilterStack *stack,
if (rect->y > current_rect.y) if (rect->y > current_rect.y)
rect->y = current_rect.y; rect->y = current_rect.y;
if (rect->width < (current_rect.width - current_rect.x)) if (rect->x + rect->width < current_rect.x + current_rect.width)
rect->width = (current_rect.width - current_rect.x); rect->width = (current_rect.x + current_rect.width - rect->x);
if (rect->height < (current_rect.height - current_rect.y)) if (rect->y + rect->height < current_rect.y + current_rect.height)
rect->height = (current_rect.height - current_rect.y); rect->height = (current_rect.y + current_rect.height - rect->y);
} }
} }
} }