[gimp] gimp:cage-transform : when pre-filling the buffer, do a check if the pixel is inside of the bounding



commit b6ef32f580e1c0acb55e0700de47c6fb56918682
Author: Michael Muré <batolettre gmail com>
Date:   Thu Mar 24 19:38:14 2011 +0100

    gimp:cage-transform : when pre-filling the buffer, do a check if the pixel is
    inside of the bounding box before computing if it's inside the cage

 app/gegl/gimpoperationcagetransform.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/app/gegl/gimpoperationcagetransform.c b/app/gegl/gimpoperationcagetransform.c
index d291fa5..cf9fbd2 100644
--- a/app/gegl/gimpoperationcagetransform.c
+++ b/app/gegl/gimpoperationcagetransform.c
@@ -220,6 +220,7 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
   GimpVector2                 plain_color;
   GeglBufferIterator         *it;
   gint                        x, y;
+  gboolean                    output_set;
 
   /* pre-fill the out buffer with no-displacement coordinate */
   it      = gegl_buffer_iterator_new (out_buf, roi, NULL, GEGL_BUFFER_WRITE);
@@ -239,13 +240,23 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
 
       while (n_pixels--)
         {
-          if (oct->fill_plain_color &&
-              gimp_cage_config_point_inside (config, x, y))
+          output_set = FALSE;
+          if (oct->fill_plain_color)
             {
-              output[0] = plain_color.x;
-              output[1] = plain_color.y;
+              if (x > cage_bb.x &&
+                  y > cage_bb.y &&
+                  x < cage_bb.x + cage_bb.width &&
+                  y < cage_bb.y + cage_bb.height)
+                {
+                  if (gimp_cage_config_point_inside (config, x, y))
+                    {
+                      output[0] = plain_color.x;
+                      output[1] = plain_color.y;
+                      output_set = TRUE;
+                    }
+                }
             }
-          else
+          if (!output_set)
             {
               output[0] = x;
               output[1] = y;



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