[gimp] Fix and optimize gimp_group_layer_duplicate()



commit a40f2b90377bd5618f79eae71cc3533773ce7e17
Author: Michael Natterer <mitch gimp org>
Date:   Mon Sep 21 22:36:26 2009 +0200

    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 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index f1b3d72..b3930a4 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]