Commit f50e06a4 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

formatting.

2007-10-23  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable-combine.c: formatting.

svn path=/trunk/; revision=23921
parent 6a629058
2007-10-23 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable-combine.c: formatting.
2007-10-23 Raphaël Quinet <raphael@gimp.org> 2007-10-23 Raphaël Quinet <raphael@gimp.org>
* plug-ins/jpeg/jpegqual.c: Added hash value for all known * plug-ins/jpeg/jpegqual.c: Added hash value for all known
...@@ -81,10 +81,10 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, ...@@ -81,10 +81,10 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable,
/* get the layer offsets */ /* get the layer offsets */
gimp_item_offsets (item, &offset_x, &offset_y); gimp_item_offsets (item, &offset_x, &offset_y);
/* make sure the image application coordinates are within image bounds */ /* make sure the image application coordinates are within drawable bounds */
x1 = CLAMP (x, 0, gimp_item_width (item)); x1 = CLAMP (x, 0, gimp_item_width (item));
y1 = CLAMP (y, 0, gimp_item_height (item)); y1 = CLAMP (y, 0, gimp_item_height (item));
x2 = CLAMP (x + src2PR->w, 0, gimp_item_width (item)); x2 = CLAMP (x + src2PR->w, 0, gimp_item_width (item));
y2 = CLAMP (y + src2PR->h, 0, gimp_item_height (item)); y2 = CLAMP (y + src2PR->h, 0, gimp_item_height (item));
if (mask) if (mask)
...@@ -93,10 +93,14 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, ...@@ -93,10 +93,14 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable,
* we need to add the layer offset to transform coords * we need to add the layer offset to transform coords
* into the mask coordinate system * into the mask coordinate system
*/ */
x1 = CLAMP (x1, -offset_x, gimp_item_width (GIMP_ITEM (mask))-offset_x); x1 = CLAMP (x1,
y1 = CLAMP (y1, -offset_y, gimp_item_height (GIMP_ITEM (mask))-offset_y); - offset_x, gimp_item_width (GIMP_ITEM (mask)) - offset_x);
x2 = CLAMP (x2, -offset_x, gimp_item_width (GIMP_ITEM (mask))-offset_x); y1 = CLAMP (y1,
y2 = CLAMP (y2, -offset_y, gimp_item_height (GIMP_ITEM (mask))-offset_y); - offset_y, gimp_item_height (GIMP_ITEM (mask)) - offset_y);
x2 = CLAMP (x2,
- offset_x, gimp_item_width (GIMP_ITEM (mask)) - offset_x);
y2 = CLAMP (y2,
- offset_y, gimp_item_height (GIMP_ITEM (mask)) - offset_y);
} }
/* If the calling procedure specified an undo step... */ /* If the calling procedure specified an undo step... */
...@@ -104,7 +108,8 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, ...@@ -104,7 +108,8 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable,
{ {
GimpDrawableUndo *undo; GimpDrawableUndo *undo;
gimp_drawable_push_undo (drawable, undo_desc, x1, y1, x2, y2, NULL, FALSE); gimp_drawable_push_undo (drawable,
undo_desc, x1, y1, x2, y2, NULL, FALSE);
undo = GIMP_DRAWABLE_UNDO (gimp_image_undo_get_fadeable (image)); undo = GIMP_DRAWABLE_UNDO (gimp_image_undo_get_fadeable (image));
...@@ -139,6 +144,7 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, ...@@ -139,6 +144,7 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable,
else else
pixel_region_init (&src1PR, gimp_drawable_get_tiles (drawable), pixel_region_init (&src1PR, gimp_drawable_get_tiles (drawable),
x1, y1, (x2 - x1), (y2 - y1), FALSE); x1, y1, (x2 - x1), (y2 - y1), FALSE);
pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable), pixel_region_init (&destPR, gimp_drawable_get_tiles (drawable),
x1, y1, (x2 - x1), (y2 - y1), TRUE); x1, y1, (x2 - x1), (y2 - y1), TRUE);
pixel_region_resize (src2PR, pixel_region_resize (src2PR,
...@@ -147,18 +153,10 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, ...@@ -147,18 +153,10 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable,
if (mask) if (mask)
{ {
gint mx, my;
/* configure the mask pixel region
* don't use x1 and y1 because they are in layer
* coordinate system. Need mask coordinate system
*/
mx = x1 + offset_x;
my = y1 + offset_y;
pixel_region_init (&maskPR, pixel_region_init (&maskPR,
gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
mx, my, x1 + offset_x,
y1 + offset_y,
(x2 - x1), (y2 - y1), (x2 - x1), (y2 - y1),
FALSE); FALSE);
...@@ -230,9 +228,9 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, ...@@ -230,9 +228,9 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable,
/* get the layer offsets */ /* get the layer offsets */
gimp_item_offsets (item, &offset_x, &offset_y); gimp_item_offsets (item, &offset_x, &offset_y);
/* make sure the image application coordinates are within image bounds */ /* make sure the image application coordinates are within drawable bounds */
x1 = CLAMP (x, 0, gimp_item_width (item)); x1 = CLAMP (x, 0, gimp_item_width (item));
y1 = CLAMP (y, 0, gimp_item_height (item)); y1 = CLAMP (y, 0, gimp_item_height (item));
x2 = CLAMP (x + src2PR->w, 0, gimp_item_width (item)); x2 = CLAMP (x + src2PR->w, 0, gimp_item_width (item));
y2 = CLAMP (y + src2PR->h, 0, gimp_item_height (item)); y2 = CLAMP (y + src2PR->h, 0, gimp_item_height (item));
...@@ -242,10 +240,14 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, ...@@ -242,10 +240,14 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable,
* we need to add the layer offset to transform coords * we need to add the layer offset to transform coords
* into the mask coordinate system * into the mask coordinate system
*/ */
x1 = CLAMP (x1, -offset_x, gimp_item_width (GIMP_ITEM (mask))-offset_x); x1 = CLAMP (x1,
y1 = CLAMP (y1, -offset_y, gimp_item_height (GIMP_ITEM (mask))-offset_y); - offset_x, gimp_item_width (GIMP_ITEM (mask)) - offset_x);
x2 = CLAMP (x2, -offset_x, gimp_item_width (GIMP_ITEM (mask))-offset_x); y1 = CLAMP (y1,
y2 = CLAMP (y2, -offset_y, gimp_item_height (GIMP_ITEM (mask))-offset_y); - offset_y, gimp_item_height (GIMP_ITEM (mask)) - offset_y);
x2 = CLAMP (x2,
- offset_x, gimp_item_width (GIMP_ITEM (mask)) - offset_x);
y2 = CLAMP (y2,
- offset_y, gimp_item_height (GIMP_ITEM (mask)) - offset_y);
} }
/* If the calling procedure specified an undo step... */ /* If the calling procedure specified an undo step... */
...@@ -267,18 +269,11 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, ...@@ -267,18 +269,11 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable,
{ {
PixelRegion mask2PR, tempPR; PixelRegion mask2PR, tempPR;
guchar *temp_data; guchar *temp_data;
gint mx, my;
/* configure the mask pixel region
* don't use x1 and y1 because they are in layer
* coordinate system. Need mask coordinate system
*/
mx = x1 + offset_x;
my = y1 + offset_y;
pixel_region_init (&mask2PR, pixel_region_init (&mask2PR,
gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)), gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
mx, my, x1 + offset_x,
y1 + offset_y,
(x2 - x1), (y2 - y1), (x2 - x1), (y2 - y1),
FALSE); FALSE);
......
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