Get rid of more x1,y1,x2,y2 uglyness

(gimp_drawable_push_undo): change x1,y1,x2,y2 parameters to
x,y,witdh,height and update all callers accordingly.
This commit is contained in:
Michael Natterer 2009-06-16 22:59:07 +02:00
parent 06a3b3a85a
commit 13cb156a80
6 changed files with 28 additions and 25 deletions

View File

@ -100,8 +100,10 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable,
{
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 - x1, y2 - y1,
NULL, FALSE);
undo = GIMP_DRAWABLE_UNDO (gimp_image_undo_get_fadeable (image));
@ -255,7 +257,10 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable,
/* If the calling procedure specified an undo step... */
if (push_undo)
gimp_drawable_push_undo (drawable, undo_desc, x1, y1, x2, y2, NULL, FALSE);
gimp_drawable_push_undo (drawable, undo_desc,
x1, y1,
x2 - x1, y2 - y1,
NULL, FALSE);
/* configure the pixel regions */
pixel_region_init (&src1PR, gimp_drawable_get_tiles (drawable),

View File

@ -1464,16 +1464,14 @@ gimp_drawable_swap_pixels (GimpDrawable *drawable,
void
gimp_drawable_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
gint x1,
gint y1,
gint x2,
gint y2,
gint x,
gint y,
gint width,
gint height,
TileManager *tiles,
gboolean sparse)
{
GimpItem *item;
gint x, y;
gint width, height;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (sparse == FALSE || tiles != NULL);
@ -1488,11 +1486,11 @@ gimp_drawable_push_undo (GimpDrawable *drawable,
#if 0
g_printerr ("gimp_drawable_push_undo (%s, %d, %d, %d, %d)\n",
sparse ? "TRUE" : "FALSE", x1, y1, x2 - x1, y2 - y1);
sparse ? "TRUE" : "FALSE", x, y, width, height);
#endif
if (! gimp_rectangle_intersect (x1, y1,
x2 - x1, y2 - y1,
if (! gimp_rectangle_intersect (x, y,
width, height,
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),

View File

@ -200,10 +200,10 @@ void gimp_drawable_swap_pixels (GimpDrawable *drawable,
void gimp_drawable_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
gint x1,
gint y1,
gint x2,
gint y2,
gint x,
gint y,
gint width,
gint height,
TileManager *tiles,
gboolean sparse);

View File

@ -500,8 +500,6 @@ gimp_image_map_apply (GimpImageMap *image_map,
void
gimp_image_map_commit (GimpImageMap *image_map)
{
gint x1, y1, x2, y2;
g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map));
if (image_map->idle_id)
@ -520,14 +518,14 @@ gimp_image_map_commit (GimpImageMap *image_map)
/* Register an undo step */
if (image_map->undo_tiles)
{
x1 = image_map->undo_offset_x;
y1 = image_map->undo_offset_y;
x2 = x1 + tile_manager_width (image_map->undo_tiles);
y2 = y1 + tile_manager_height (image_map->undo_tiles);
gint x = image_map->undo_offset_x;
gint y = image_map->undo_offset_y;
gint width = tile_manager_width (image_map->undo_tiles);
gint height = tile_manager_height (image_map->undo_tiles);
gimp_drawable_push_undo (image_map->drawable,
image_map->undo_desc,
x1, y1, x2, y2,
x, y, width, height,
image_map->undo_tiles, FALSE);
tile_manager_unref (image_map->undo_tiles);

View File

@ -710,7 +710,9 @@ gimp_selection_extract (GimpSelection *selection,
{
if (cut_image && non_empty)
gimp_drawable_push_undo (GIMP_DRAWABLE (pickable), NULL,
x1, y1, x2, y2, NULL, FALSE);
x1, y1,
x2 - x1, y2 - y1,
NULL, FALSE);
gimp_item_get_offset (GIMP_ITEM (pickable), &off_x, &off_y);
colormap = gimp_drawable_get_colormap (GIMP_DRAWABLE (pickable));

View File

@ -436,7 +436,7 @@ gimp_paint_core_finish (GimpPaintCore *core,
gimp_drawable_push_undo (drawable, NULL,
core->x1, core->y1,
core->x2, core->y2,
core->x2 - core->x1, core->y2 - core->y1,
core->undo_tiles,
TRUE);