From 3003ca1b5c7977b9705a83aacb6a760f639562a6 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 28 Jan 2007 15:06:23 +0000 Subject: [PATCH] add the passed TileManager's size to undo->size. 2007-01-28 Michael Natterer * 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 --- ChangeLog | 8 ++++++++ app/core/gimpdrawableundo.c | 4 ++++ app/core/gimpimage-undo-push.c | 5 +---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61cbff3216..022316003f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-01-28 Michael Natterer + + * 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 * app/core/Makefile.am diff --git a/app/core/gimpdrawableundo.c b/app/core/gimpdrawableundo.c index d1a6794809..5d885a3ba6 100644 --- a/app/core/gimpdrawableundo.c +++ b/app/core/gimpdrawableundo.c @@ -134,6 +134,10 @@ gimp_drawable_undo_constructor (GType type, drawable_undo = GIMP_DRAWABLE_UNDO (object); 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; } diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index f8cc9b4612..4b7cc10511 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -702,7 +702,6 @@ gimp_image_undo_push_drawable (GimpImage *image, { GimpItem *item; GimpUndo *new; - gint64 size; g_return_val_if_fail (GIMP_IS_IMAGE (image), 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), FALSE); - size = tile_manager_get_memsize (tiles, sparse); - if ((new = gimp_image_undo_push (image, GIMP_TYPE_DRAWABLE_UNDO, - size, 0, + 0, 0, GIMP_UNDO_DRAWABLE, undo_desc, GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE, NULL,