add the passed TileManager's size to undo->size.

2007-01-28  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawableundo.c (gimp_drawable_undo_constructor):
	add the passed TileManager's size to undo->size.

	* app/core/gimpimage-undo-push.c (gimp_image_undo_push_drawable):
	no need to get and pass the TileManager's size here.


svn path=/trunk/; revision=21787
This commit is contained in:
Michael Natterer 2007-01-28 15:06:23 +00:00 committed by Michael Natterer
parent 14fa7e3a41
commit 3003ca1b5c
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2007-01-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawableundo.c (gimp_drawable_undo_constructor):
add the passed TileManager's size to undo->size.
* app/core/gimpimage-undo-push.c (gimp_image_undo_push_drawable):
no need to get and pass the TileManager's size here.
2007-01-28 Michael Natterer <mitch@gimp.org> 2007-01-28 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am * app/core/Makefile.am

View File

@ -134,6 +134,10 @@ gimp_drawable_undo_constructor (GType type,
drawable_undo = GIMP_DRAWABLE_UNDO (object); drawable_undo = GIMP_DRAWABLE_UNDO (object);
g_assert (GIMP_IS_DRAWABLE (GIMP_ITEM_UNDO (object)->item)); g_assert (GIMP_IS_DRAWABLE (GIMP_ITEM_UNDO (object)->item));
g_assert (drawable_undo->tiles != NULL);
GIMP_UNDO (object)->size += tile_manager_get_memsize (drawable_undo->tiles,
drawable_undo->sparse);
return object; return object;
} }

View File

@ -702,7 +702,6 @@ gimp_image_undo_push_drawable (GimpImage *image,
{ {
GimpItem *item; GimpItem *item;
GimpUndo *new; GimpUndo *new;
gint64 size;
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
@ -722,10 +721,8 @@ gimp_image_undo_push_drawable (GimpImage *image,
tile_manager_height (tiles) == gimp_item_height (item), tile_manager_height (tiles) == gimp_item_height (item),
FALSE); FALSE);
size = tile_manager_get_memsize (tiles, sparse);
if ((new = gimp_image_undo_push (image, GIMP_TYPE_DRAWABLE_UNDO, if ((new = gimp_image_undo_push (image, GIMP_TYPE_DRAWABLE_UNDO,
size, 0, 0, 0,
GIMP_UNDO_DRAWABLE, undo_desc, GIMP_UNDO_DRAWABLE, undo_desc,
GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE, GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE,
NULL, NULL,