From a40f2b90377bd5618f79eae71cc3533773ce7e17 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 21 Sep 2009 22:36:26 +0200 Subject: [PATCH] Fix and optimize gimp_group_layer_duplicate() Make sure the duplicated group layer actually has a properly set up tile manager taken from its projection, and not just a dumb copy of the original group's tiles. Also optimizes away useless calls to gimp_group_layer_update_size(). --- app/core/gimpgrouplayer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c index f1b3d72f5d..b3930a4fce 100644 --- a/app/core/gimpgrouplayer.c +++ b/app/core/gimpgrouplayer.c @@ -337,6 +337,8 @@ gimp_group_layer_duplicate (GimpItem *item, gint position = 0; GList *list; + gimp_group_layer_suspend_resize (new_group, FALSE); + for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (group->children)); list; list = g_list_next (list)) @@ -369,6 +371,13 @@ gimp_group_layer_duplicate (GimpItem *item, GIMP_OBJECT (new_child), position++); } + + /* FIXME: need to change the item's extents to resume_resize() + * will actually reallocate the projection's pyramid + */ + GIMP_ITEM (new_group)->width++; + + gimp_group_layer_resume_resize (new_group, FALSE); } return new_item; -- GitLab