[gimp] Skip group layers when transforming the entire image



commit 86a76d6237fa7fe4b39a0b3f4f48b704be81f788
Author: Michael Natterer <mitch gimp org>
Date:   Tue Aug 25 15:46:53 2009 +0200

    Skip group layers when transforming the entire image
    
    Group layers update themselves when their children change, so simply
    skip them when cropping, flipping, resizing, rotating or scaling the
    image.

 app/core/gimpimage-crop.c   |    4 ++++
 app/core/gimpimage-flip.c   |    4 ++++
 app/core/gimpimage-resize.c |    4 ++++
 app/core/gimpimage-rotate.c |    4 ++++
 app/core/gimpimage-scale.c  |    8 ++++++++
 5 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpimage-crop.c b/app/core/gimpimage-crop.c
index 40ebcde..b96b972 100644
--- a/app/core/gimpimage-crop.c
+++ b/app/core/gimpimage-crop.c
@@ -178,6 +178,10 @@ gimp_image_crop (GimpImage   *image,
         {
           item = (GimpItem *) list->data;
 
+          /*  group layers are updated automatically  */
+          if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
+            continue;
+
           gimp_item_translate (item, -x1, -y1, TRUE);
 
           if (crop_layers)
diff --git a/app/core/gimpimage-flip.c b/app/core/gimpimage-flip.c
index 10a5971..b0b0920 100644
--- a/app/core/gimpimage-flip.c
+++ b/app/core/gimpimage-flip.c
@@ -116,6 +116,10 @@ gimp_image_flip (GimpImage           *image,
     {
       GimpItem *item = list->data;
 
+      /*  group layers are updated automatically  */
+      if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
+        continue;
+
       gimp_item_flip (item, context, flip_type, axis, FALSE);
 
       if (progress)
diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c
index c4fcc37..b0447c5 100644
--- a/app/core/gimpimage-resize.c
+++ b/app/core/gimpimage-resize.c
@@ -154,6 +154,10 @@ gimp_image_resize_with_layers (GimpImage    *image,
       gint      old_offset_x;
       gint      old_offset_y;
 
+      /*  group layers are updated automatically  */
+      if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
+        continue;
+
       gimp_item_get_offset (item, &old_offset_x, &old_offset_y);
 
       gimp_item_translate (item, offset_x, offset_y, TRUE);
diff --git a/app/core/gimpimage-rotate.c b/app/core/gimpimage-rotate.c
index a41122d..ab22188 100644
--- a/app/core/gimpimage-rotate.c
+++ b/app/core/gimpimage-rotate.c
@@ -176,6 +176,10 @@ gimp_image_rotate (GimpImage        *image,
       gint      off_x;
       gint      off_y;
 
+      /*  group layers are updated automatically  */
+      if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
+        continue;
+
       gimp_item_get_offset (item, &off_x, &off_y);
 
       gimp_item_rotate (item, context, rotate_type, center_x, center_y, FALSE);
diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c
index 657ce0b..31808f8 100644
--- a/app/core/gimpimage-scale.c
+++ b/app/core/gimpimage-scale.c
@@ -150,6 +150,10 @@ gimp_image_scale (GimpImage             *image,
       gimp_sub_progress_set_step (GIMP_SUB_PROGRESS (sub_progress),
                                   progress_current++, progress_steps);
 
+      /*  group layers are updated automatically  */
+      if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
+        continue;
+
       if (! gimp_item_scale_by_factors (item,
                                         img_scale_w, img_scale_h,
                                         interpolation_type, sub_progress))
@@ -327,6 +331,10 @@ gimp_image_scale_check (const GimpImage *image,
     {
       GimpItem *item = list->data;
 
+      /*  group layers are updated automatically  */
+      if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
+        continue;
+
       if (! gimp_item_check_scaling (item, new_width, new_height))
         {
           g_list_free (all_layers);



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