diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c index e1cec8cb6e..b2e8a8bd87 100644 --- a/app/core/gimpdrawable-combine.c +++ b/app/core/gimpdrawable-combine.c @@ -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), diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 55f2d8f466..3e9f6a5e96 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -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), diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 36f75f8c07..e358d12e86 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -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); diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c index c5d8fe5ea1..94a5da85aa 100644 --- a/app/core/gimpimagemap.c +++ b/app/core/gimpimagemap.c @@ -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); diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c index 5c037aa4e7..9b197a6b1f 100644 --- a/app/core/gimpselection.c +++ b/app/core/gimpselection.c @@ -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)); diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index 32de5a2142..3f7a1dec4a 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -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);