Commit 94a404ed authored by Massimo Valentini's avatar Massimo Valentini

Bug 639920: Gaussian blur can't work on specified selection

In presence of a selection extend the area processed
parent 79be7de8
......@@ -736,7 +736,7 @@ sel_gauss (GimpDrawable *drawable,
gboolean has_alpha;
guchar *dest;
guchar *src;
gint x, y;
gint x, y, x2, y2;
gint width, height;
gdouble *mat;
gint numrad;
......@@ -752,6 +752,14 @@ sel_gauss (GimpDrawable *drawable,
mat = g_new (gdouble, numrad);
init_matrix (radius, mat, numrad);
x2 = MIN (x + width - 1 + numrad, drawable->width);
y2 = MIN (y + height - 1 + numrad, drawable->height);
x = MAX (x - numrad + 1, 0);
y = MAX (y - numrad + 1, 0);
width = x2 - x;
height = y2 - y;
/* allocate with extra padding because MMX instructions may read
more than strictly necessary */
src = g_new (guchar, width * height * bytes + 16);
......
......@@ -1442,8 +1442,20 @@ gauss (GimpDrawable *drawable,
preview_buffer = g_new (guchar, width * height * drawable->bpp);
}
else if (! gimp_drawable_mask_intersect (drawable->drawable_id,
&x, &y, &width, &height))
else if (gimp_drawable_mask_intersect (drawable->drawable_id,
&x, &y, &width, &height))
{ /* With a selection, extend the input area of the amount required */
gint hor_extra = method == BLUR_IIR ? 4 : 1 + ceil (horz);
gint ver_extra = method == BLUR_IIR ? 4 : 1 + ceil (vert);
gint x2 = x + width;
gint y2 = y + height;
x = MAX (x - hor_extra, 0);
y = MAX (y - ver_extra, 0);
width = MIN (x2 + hor_extra, drawable->width) - x;
height = MIN (y2 + ver_extra, drawable->height) - y;
}
else
{
return;
}
......
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