[gimp] pdb: fix formatting of generated code in item_transform.pdb



commit 12d38816a5cf7e5d2796665a78b333dc0c9ad24f
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 19 01:03:29 2018 +0200

    pdb: fix formatting of generated code in item_transform.pdb

 app/pdb/item-transform-cmds.c |   29 +++++++++++++++--------------
 pdb/groups/item_transform.pdb |   19 ++++++++++++-------
 2 files changed, 27 insertions(+), 21 deletions(-)
---
diff --git a/app/pdb/item-transform-cmds.c b/app/pdb/item-transform-cmds.c
index 6ec2a8a..9d4993c 100644
--- a/app/pdb/item-transform-cmds.c
+++ b/app/pdb/item-transform-cmds.c
@@ -148,8 +148,8 @@ item_transform_flip_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = gimp_pdb_item_is_attached (item, NULL,
-                                                        GIMP_PDB_ITEM_CONTENT |
-                                                        GIMP_PDB_ITEM_POSITION, error);
+                                           GIMP_PDB_ITEM_CONTENT |
+                                           GIMP_PDB_ITEM_POSITION, error);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
@@ -245,8 +245,8 @@ item_transform_perspective_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = gimp_pdb_item_is_attached (item, NULL,
-                                                        GIMP_PDB_ITEM_CONTENT |
-                                                        GIMP_PDB_ITEM_POSITION, error);
+                                           GIMP_PDB_ITEM_CONTENT |
+                                           GIMP_PDB_ITEM_POSITION, error);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
@@ -416,8 +416,8 @@ item_transform_rotate_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = gimp_pdb_item_is_attached (item, NULL,
-                                                        GIMP_PDB_ITEM_CONTENT |
-                                                        GIMP_PDB_ITEM_POSITION, error);
+                                           GIMP_PDB_ITEM_CONTENT |
+                                           GIMP_PDB_ITEM_POSITION, error);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
@@ -510,8 +510,9 @@ item_transform_scale_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = (gimp_pdb_item_is_attached (item, NULL,
-                                                          GIMP_PDB_ITEM_CONTENT |
-                                                          GIMP_PDB_ITEM_POSITION, error) && x0 < x1 && y0 < 
y1);
+                                            GIMP_PDB_ITEM_CONTENT |
+                                            GIMP_PDB_ITEM_POSITION, error) &&
+                 x0 < x1 && y0 < y1);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
@@ -597,8 +598,8 @@ item_transform_shear_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = gimp_pdb_item_is_attached (item, NULL,
-                                                        GIMP_PDB_ITEM_CONTENT |
-                                                        GIMP_PDB_ITEM_POSITION, error);
+                                           GIMP_PDB_ITEM_CONTENT |
+                                           GIMP_PDB_ITEM_POSITION, error);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
@@ -694,8 +695,8 @@ item_transform_2d_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = gimp_pdb_item_is_attached (item, NULL,
-                                                        GIMP_PDB_ITEM_CONTENT |
-                                                        GIMP_PDB_ITEM_POSITION, error);
+                                           GIMP_PDB_ITEM_CONTENT |
+                                           GIMP_PDB_ITEM_POSITION, error);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
@@ -796,8 +797,8 @@ item_transform_matrix_invoker (GimpProcedure         *procedure,
       gint x, y, width, height;
 
       success = gimp_pdb_item_is_attached (item, NULL,
-                                                        GIMP_PDB_ITEM_CONTENT |
-                                                        GIMP_PDB_ITEM_POSITION, error);
+                                           GIMP_PDB_ITEM_CONTENT |
+                                           GIMP_PDB_ITEM_POSITION, error);
 
       if (success &&
           gimp_item_mask_intersect (item, &x, &y, &width, &height))
diff --git a/pdb/groups/item_transform.pdb b/pdb/groups/item_transform.pdb
index 694cb68..b234d9d 100644
--- a/pdb/groups/item_transform.pdb
+++ b/pdb/groups/item_transform.pdb
@@ -22,14 +22,19 @@
 
 sub transform_invoke {
     my ($progress_text, $assemble_matrix, $check) = @_;
-    my $success_check = 'gimp_pdb_item_is_attached (item, NULL,
-                                                    GIMP_PDB_ITEM_CONTENT |
-                                                    GIMP_PDB_ITEM_POSITION, error);';
+    my $success_check = <<"CODE";
+  success = gimp_pdb_item_is_attached (item, NULL,
+                                       GIMP_PDB_ITEM_CONTENT |
+                                       GIMP_PDB_ITEM_POSITION, error);
+CODE
 
     if ($check) {
-        $success_check = "(gimp_pdb_item_is_attached (item, NULL,
-                                                      GIMP_PDB_ITEM_CONTENT |
-                                                      GIMP_PDB_ITEM_POSITION, error) && " . $check . ");";
+        $success_check = <<"CODE"
+  success = (gimp_pdb_item_is_attached (item, NULL,
+                                        GIMP_PDB_ITEM_CONTENT |
+                                        GIMP_PDB_ITEM_POSITION, error) &&
+            $check);
+CODE
     }
 
     %invoke = (
@@ -37,7 +42,7 @@ sub transform_invoke {
 {
   gint x, y, width, height;
 
-  success = $success_check
+$success_check
 
   if (success &&
       gimp_item_mask_intersect (item, &x, &y, &width, &height))


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