[gimp/goat-invasion: 237/418] app: chnage gimp_gegl_create_apply_opacity_node()'s mask offset



commit 175d34f2f43202f6c0ce12f02836e2e76f1b4507
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 24 15:22:49 2012 +0100

    app: chnage gimp_gegl_create_apply_opacity_node()'s mask offset
    
    to be the offset *of* the mask, not the offset *into* the mask, also
    reorder parameters.

 app/core/gimpdrawable-bucket-fill.c |    7 ++++---
 app/core/gimpdrawable-stroke.c      |    3 +--
 app/core/gimplayer.c                |    4 ++--
 app/core/gimpselection.c            |    7 ++++---
 app/gegl/gimp-gegl-nodes.c          |    9 ++++-----
 app/gegl/gimp-gegl-nodes.h          |    5 ++---
 6 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c
index e1eb116..caae809 100644
--- a/app/core/gimpdrawable-bucket-fill.c
+++ b/app/core/gimpdrawable-bucket-fill.c
@@ -245,9 +245,10 @@ gimp_drawable_bucket_fill_internal (GimpDrawable        *drawable,
       break;
     }
 
-  apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 1.0,
-                                                       mask_offset_x,
-                                                       mask_offset_y);
+  apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer,
+                                                       -mask_offset_x,
+                                                       -mask_offset_y,
+                                                       1.0);
 
   gimp_apply_operation (buffer, NULL, NULL,
                         apply_opacity, 1.0,
diff --git a/app/core/gimpdrawable-stroke.c b/app/core/gimpdrawable-stroke.c
index 1e87092..78ef8a6 100644
--- a/app/core/gimpdrawable-stroke.c
+++ b/app/core/gimpdrawable-stroke.c
@@ -380,8 +380,7 @@ gimp_drawable_stroke_scan_convert (GimpDrawable    *drawable,
       break;
     }
 
-  apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 1.0,
-                                                       0, 0);
+  apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 0, 0, 1.0);
 
   gimp_apply_operation (base_buffer, NULL, NULL,
                         apply_opacity, 1.0,
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 4bc256d..3518554 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1574,8 +1574,8 @@ gimp_layer_apply_mask (GimpLayer         *layer,
       mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (mask));
       dest_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
 
-      apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 1.0,
-                                                           0, 0);
+      apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 0, 0,
+                                                           1.0);
 
       gimp_drawable_apply_operation_to_buffer (GIMP_DRAWABLE (layer), NULL, NULL,
                                                apply_opacity, TRUE, dest_buffer);
diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c
index 34998f4..21c77fa 100644
--- a/app/core/gimpselection.c
+++ b/app/core/gimpselection.c
@@ -732,9 +732,10 @@ gimp_selection_extract (GimpSelection *selection,
 
       mask_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (selection));
 
-      apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer, 1.0,
-                                                           x1 + off_x,
-                                                           y1 + off_y);
+      apply_opacity = gimp_gegl_create_apply_opacity_node (mask_buffer,
+                                                           - (off_x + x1),
+                                                           - (off_y + y1),
+                                                           1.0);
 
       gimp_apply_operation (dest_buffer, NULL, NULL,
                             apply_opacity, TRUE,
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index da6ec01..0e78384 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -68,10 +68,9 @@ gimp_gegl_create_flatten_node (const GimpRGB *background)
 
 GeglNode *
 gimp_gegl_create_apply_opacity_node (GeglBuffer *mask,
-                                     gdouble     opacity,
-                                     /* offsets *into* the mask */
                                      gint        mask_offset_x,
-                                     gint        mask_offset_y)
+                                     gint        mask_offset_y,
+                                     gdouble     opacity)
 {
   GeglNode  *node;
   GeglNode  *input;
@@ -92,8 +91,8 @@ gimp_gegl_create_apply_opacity_node (GeglBuffer *mask,
                                       NULL);
 
   mask_source = gimp_gegl_add_buffer_source (node, mask,
-                                             -mask_offset_x,
-                                             -mask_offset_y);
+                                             mask_offset_x,
+                                             mask_offset_y);
 
   gegl_node_connect_to (input,        "output",
                         opacity_node, "input");
diff --git a/app/gegl/gimp-gegl-nodes.h b/app/gegl/gimp-gegl-nodes.h
index 36396c7..17e8c99 100644
--- a/app/gegl/gimp-gegl-nodes.h
+++ b/app/gegl/gimp-gegl-nodes.h
@@ -24,10 +24,9 @@
 
 GeglNode * gimp_gegl_create_flatten_node       (const GimpRGB        *background);
 GeglNode * gimp_gegl_create_apply_opacity_node (GeglBuffer           *mask,
-                                                gdouble               opacity,
-                                                /* offsets *into* the mask */
                                                 gint                  mask_offset_x,
-                                                gint                  mask_offset_y);
+                                                gint                  mask_offset_y,
+                                                gdouble               opacity);
 GeglNode * gimp_gegl_create_apply_buffer_node  (GeglBuffer           *buffer,
                                                 gint                  buffer_offset_x,
                                                 gint                  buffer_offset_y,



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