[gimp] Bug 600554 - Implement layer group transforms



commit e24795f16784009ae6681e330cb2621df1271c48
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 17 22:00:38 2011 +0100

    Bug 600554 - Implement layer group transforms
    
    Same fix for the PDB: if the item to transform is a group layer, call
    gimp_item_transform()/rotate()/... directly instead of going through
    the wrong cut/transform/paste code path.

 app/pdb/item-transform-cmds.c       |   27 ++++++++++++++++++---------
 tools/pdbgen/pdb/item_transform.pdb |    9 ++++++---
 2 files changed, 24 insertions(+), 12 deletions(-)
---
diff --git a/app/pdb/item-transform-cmds.c b/app/pdb/item-transform-cmds.c
index 0ab4992..65969ac 100644
--- a/app/pdb/item-transform-cmds.c
+++ b/app/pdb/item-transform-cmds.c
@@ -80,7 +80,8 @@ item_transform_flip_simple_invoker (GimpProcedure      *procedure,
           gimp_transform_get_flip_axis (x, y, width, height,
                                         flip_type, auto_center, &axis);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -157,7 +158,8 @@ item_transform_flip_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("Flipping"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -255,7 +257,8 @@ item_transform_perspective_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("Perspective"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -337,7 +340,8 @@ item_transform_rotate_simple_invoker (GimpProcedure      *procedure,
           gimp_transform_get_rotate_center (x, y, width, height,
                                             auto_center, &center_x, &center_y);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -422,7 +426,8 @@ item_transform_rotate_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("Rotating"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -511,7 +516,8 @@ item_transform_scale_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("Scaling"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -596,7 +602,8 @@ item_transform_shear_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("Shearing"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -692,7 +699,8 @@ item_transform_2d_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("2D Transform"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
@@ -796,7 +804,8 @@ item_transform_matrix_invoker (GimpProcedure      *procedure,
           if (progress)
             gimp_progress_start (progress, _("2D Transforming"), FALSE);
 
-          if (GIMP_IS_DRAWABLE (item))
+          if (GIMP_IS_DRAWABLE (item) &&
+              ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
             {
               GimpDrawable *drawable;
 
diff --git a/tools/pdbgen/pdb/item_transform.pdb b/tools/pdbgen/pdb/item_transform.pdb
index 20ec691..a77cf7f 100644
--- a/tools/pdbgen/pdb/item_transform.pdb
+++ b/tools/pdbgen/pdb/item_transform.pdb
@@ -52,7 +52,8 @@ $assemble_matrix
       if (progress)
         gimp_progress_start (progress, _(\"$progress_text\"), FALSE);
 
-      if (GIMP_IS_DRAWABLE (item))
+      if (GIMP_IS_DRAWABLE (item) &&
+          ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
         {
           GimpDrawable *drawable;
 
@@ -148,7 +149,8 @@ HELP
       gimp_transform_get_flip_axis (x, y, width, height,
                                     flip_type, auto_center, &axis);
 
-      if (GIMP_IS_DRAWABLE (item))
+      if (GIMP_IS_DRAWABLE (item) &&
+          ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
         {
           GimpDrawable *drawable;
 
@@ -353,7 +355,8 @@ HELP
       gimp_transform_get_rotate_center (x, y, width, height,
                                         auto_center, &center_x, &center_y);
 
-      if (GIMP_IS_DRAWABLE (item))
+      if (GIMP_IS_DRAWABLE (item) &&
+          ! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
         {
           GimpDrawable *drawable;
 



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