Bill Skaggs <weskaggs@primate.ucdavis.edu>

* app/paint/gimpheal.c: make the healing brush work properly
	when dragged.  Fixes bug #492575.

svn path=/trunk/; revision=24307
This commit is contained in:
William Skaggs 2007-12-10 19:26:36 +00:00
parent 4c7289a54b
commit 20e9c4f00f
2 changed files with 21 additions and 20 deletions

View File

@ -1,3 +1,8 @@
2007-12-10 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/paint/gimpheal.c: make the healing brush work properly
when dragged. Fixes bug #492575.
2007-12-09 Hans Breuer <hans@breuer.org> 2007-12-09 Hans Breuer <hans@breuer.org>
* app/gimp-log.h : an ugly but working variant for no varargs macros * app/gimp-log.h : an ugly but working variant for no varargs macros

View File

@ -189,6 +189,8 @@ gimp_heal_divide (PixelRegion *topPR,
guchar *b; guchar *b;
gdouble *r = result; gdouble *r = result;
g_assert (topPR->bytes == bottomPR->bytes);
for (i = 0; i < height; i++) for (i = 0; i < height; i++)
{ {
t = t_data; t = t_data;
@ -232,6 +234,8 @@ gimp_heal_multiply (gdouble *first,
guchar *s; guchar *s;
guchar *r; guchar *r;
g_assert (secondPR->bytes == resultPR->bytes);
for (i = 0; i < height; i++) for (i = 0; i < height; i++)
{ {
s = s_data; s = s_data;
@ -404,8 +408,13 @@ gimp_heal_motion (GimpSourceCore *source_core,
src = temp_buf_new (srcPR->w, srcPR->h, src = temp_buf_new (srcPR->w, srcPR->h,
GIMP_IMAGE_TYPE_BYTES (GIMP_IMAGE_TYPE_WITH_ALPHA (src_type)), GIMP_IMAGE_TYPE_BYTES (GIMP_IMAGE_TYPE_WITH_ALPHA (src_type)),
0, 0, NULL); 0, 0, NULL);
pixel_region_init_temp_buf (&tempPR, src, 0, 0, src->width, src->height); pixel_region_init_temp_buf (&tempPR, src, 0, 0, src->width, src->height);
/*
* the effect of the following is to copy the contents of the source
* region to the "src" temp-buf, adding an alpha channel if necessary
*/
if (GIMP_IMAGE_TYPE_HAS_ALPHA (src_type)) if (GIMP_IMAGE_TYPE_HAS_ALPHA (src_type))
copy_region (srcPR, &tempPR); copy_region (srcPR, &tempPR);
else else
@ -440,23 +449,9 @@ gimp_heal_motion (GimpSourceCore *source_core,
* is perhaps counter-intutitive? * is perhaps counter-intutitive?
*/ */
/* Get the area underneath the cursor */ pixel_region_init (&origPR, gimp_drawable_get_tiles (drawable),
{ paint_area->x, paint_area->y,
TempBuf *orig; paint_area->width, paint_area->height, FALSE);
gint x1, x2, y1, y2;
x1 = paint_area->x + paint_area_offset_x;
y1 = paint_area->y + paint_area_offset_y;
x2 = x1 + paint_area_width;
y2 = y1 + paint_area_height;
/* get the original image data at the cursor location */
orig = gimp_paint_core_get_orig_image (paint_core, drawable,
x1, y1, x2, y2);
pixel_region_init_temp_buf (&origPR, orig, 0, 0,
paint_area_width, paint_area_height);
}
temp = temp_buf_new (origPR.w, origPR.h, temp = temp_buf_new (origPR.w, origPR.h,
gimp_drawable_bytes_with_alpha (drawable), gimp_drawable_bytes_with_alpha (drawable),
@ -484,8 +479,9 @@ gimp_heal_motion (GimpSourceCore *source_core,
if ((srcPR->w != tempPR.w) || (srcPR->w != destPR.w) || if ((srcPR->w != tempPR.w) || (srcPR->w != destPR.w) ||
(srcPR->h != tempPR.h) || (srcPR->h != destPR.h)) (srcPR->h != tempPR.h) || (srcPR->h != destPR.h))
{ {
g_printerr ("%s: Error: Source and destination are not the same size.", /* this generally means that the source point has hit the edge of the
G_STRFUNC); layer, so it is not an error and we should not complain, just
don't do anything */
temp_buf_free (src); temp_buf_free (src);
temp_buf_free (temp); temp_buf_free (temp);
return; return;
@ -509,7 +505,7 @@ gimp_heal_motion (GimpSourceCore *source_core,
MIN (opacity, GIMP_OPACITY_OPAQUE), MIN (opacity, GIMP_OPACITY_OPAQUE),
gimp_context_get_opacity (context), gimp_context_get_opacity (context),
gimp_paint_options_get_brush_mode (paint_options), gimp_paint_options_get_brush_mode (paint_options),
GIMP_PAINT_CONSTANT); GIMP_PAINT_INCREMENTAL);
temp_buf_free (src); temp_buf_free (src);
temp_buf_free (temp); temp_buf_free (temp);