Commit a40f2b90 authored by Michael Natterer's avatar Michael Natterer 😴

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
parent 43cf8e92
...@@ -337,6 +337,8 @@ gimp_group_layer_duplicate (GimpItem *item, ...@@ -337,6 +337,8 @@ gimp_group_layer_duplicate (GimpItem *item,
gint position = 0; gint position = 0;
GList *list; GList *list;
gimp_group_layer_suspend_resize (new_group, FALSE);
for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (group->children)); for (list = gimp_item_stack_get_item_iter (GIMP_ITEM_STACK (group->children));
list; list;
list = g_list_next (list)) list = g_list_next (list))
...@@ -369,6 +371,13 @@ gimp_group_layer_duplicate (GimpItem *item, ...@@ -369,6 +371,13 @@ gimp_group_layer_duplicate (GimpItem *item,
GIMP_OBJECT (new_child), GIMP_OBJECT (new_child),
position++); 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; return new_item;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment