pass the width and height of the sub-area of paint_area to

2006-09-07  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimpsourcecore.[ch] (gimp_source_core_motion): pass
	the width and height of the sub-area of paint_area to
	GimpSourceCore::motion().

	* app/paint/gimpclone.c (gimp_clone_motion)
	* app/paint/gimpheal.c (gimp_heal_motion): use the new parameters
	instead of taking these values from srcPR->w and ->h, which was
	very confusing.
This commit is contained in:
Michael Natterer 2006-09-07 08:49:52 +00:00 committed by Michael Natterer
parent 89977ad403
commit f83925673f
5 changed files with 44 additions and 12 deletions

View File

@ -1,3 +1,14 @@
2006-09-07 Michael Natterer <mitch@gimp.org>
* app/paint/gimpsourcecore.[ch] (gimp_source_core_motion): pass
the width and height of the sub-area of paint_area to
GimpSourceCore::motion().
* app/paint/gimpclone.c (gimp_clone_motion)
* app/paint/gimpheal.c (gimp_heal_motion): use the new parameters
instead of taking these values from srcPR->w and ->h, which was
very confusing.
2006-09-07 Sven Neumann <sven@gimp.org>
* app/actions/edit-actions.c (edit_actions_setup): set the context

View File

@ -60,7 +60,9 @@ static void gimp_clone_motion (GimpSourceCore *source_core,
PixelRegion *srcPR,
TempBuf *paint_area,
gint paint_area_offset_x,
gint paint_area_offset_y);
gint paint_area_offset_y,
gint paint_area_width,
gint paint_area_height);
static void gimp_clone_line_image (GimpImage *dest,
GimpImage *src,
@ -150,7 +152,9 @@ gimp_clone_motion (GimpSourceCore *source_core,
PixelRegion *srcPR,
TempBuf *paint_area,
gint paint_area_offset_x,
gint paint_area_offset_y)
gint paint_area_offset_y,
gint paint_area_width,
gint paint_area_height)
{
GimpPaintCore *paint_core = GIMP_PAINT_CORE (source_core);
GimpCloneOptions *options = GIMP_CLONE_OPTIONS (paint_options);
@ -170,7 +174,7 @@ gimp_clone_motion (GimpSourceCore *source_core,
case GIMP_IMAGE_CLONE:
pixel_region_init_temp_buf (&destPR, paint_area,
paint_area_offset_x, paint_area_offset_y,
srcPR->w, srcPR->h);
paint_area_width, paint_area_height);
pr = pixel_regions_register (2, srcPR, &destPR);
break;

View File

@ -58,7 +58,9 @@ static void gimp_heal_motion (GimpSourceCore *source_core,
PixelRegion *srcPR,
TempBuf *paint_area,
gint paint_area_offset_x,
gint paint_area_offset_y);
gint paint_area_offset_y,
gint paint_area_width,
gint paint_area_height);
G_DEFINE_TYPE (GimpHeal, gimp_heal, GIMP_TYPE_SOURCE_CORE)
@ -348,7 +350,9 @@ gimp_heal_motion (GimpSourceCore *source_core,
PixelRegion *srcPR,
TempBuf *paint_area,
gint paint_area_offset_x,
gint paint_area_offset_y)
gint paint_area_offset_y,
gint paint_area_width,
gint paint_area_height)
{
GimpPaintCore *paint_core = GIMP_PAINT_CORE (source_core);
GimpContext *context = GIMP_CONTEXT (paint_options);
@ -394,14 +398,15 @@ gimp_heal_motion (GimpSourceCore *source_core,
x1 = paint_area->x + paint_area_offset_x;
y1 = paint_area->y + paint_area_offset_y;
x2 = x1 + srcPR->w;
y2 = y1 + srcPR->h;
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, x2 - x1, y2 - y1);
pixel_region_init_temp_buf (&origPR, orig, 0, 0,
paint_area_width, paint_area_height);
}
temp = temp_buf_new (origPR.w, origPR.h,
@ -439,7 +444,7 @@ gimp_heal_motion (GimpSourceCore *source_core,
/* get the destination to paint to */
pixel_region_init_temp_buf (&destPR, paint_area,
paint_area_offset_x, paint_area_offset_y,
srcPR->w, srcPR->h);
paint_area_width, paint_area_height);
/* check that srcPR, tempPR, and destPR are the same size */
if ((srcPR->w != tempPR.w) || (srcPR->w != destPR.w) ||

View File

@ -281,6 +281,8 @@ gimp_source_core_motion (GimpSourceCore *source_core,
GimpPickable *src_pickable = NULL;
PixelRegion srcPR;
TempBuf *paint_area;
gint paint_area_width;
gint paint_area_height;
gint offset_x;
gint offset_y;
gdouble opacity;
@ -322,6 +324,9 @@ gimp_source_core_motion (GimpSourceCore *source_core,
if (! paint_area)
return;
paint_area_width = paint_area->width;
paint_area_height = paint_area->height;
if (options->use_source)
{
TileManager *src_tiles = gimp_pickable_get_tiles (src_pickable);
@ -346,7 +351,7 @@ gimp_source_core_motion (GimpSourceCore *source_core,
* Otherwise, we need a call to get_orig_image to make sure
* we get a copy of the unblemished (offset) image
*/
if (( options->sample_merged && (src_image != image)) ||
if (( options->sample_merged && (src_image != image)) ||
(! options->sample_merged && (source_core->src_drawable != drawable)))
{
pixel_region_init (&srcPR, src_tiles,
@ -372,6 +377,9 @@ gimp_source_core_motion (GimpSourceCore *source_core,
offset_x = x1 - (paint_area->x + offset_x);
offset_y = y1 - (paint_area->y + offset_y);
paint_area_width = x2 - x1;
paint_area_height = y2 - y1;
}
/* Set the paint area to transparent */
@ -385,7 +393,9 @@ gimp_source_core_motion (GimpSourceCore *source_core,
src_pickable,
&srcPR,
paint_area,
offset_x, offset_y);
offset_x, offset_y,
paint_area_width,
paint_area_height);
}
static void

View File

@ -65,7 +65,9 @@ struct _GimpSourceCoreClass
PixelRegion *srcPR,
TempBuf *paint_area,
gint paint_area_offset_x,
gint paint_area_offset_y);
gint paint_area_offset_y,
gint paint_area_width,
gint paint_area_height);
};