[gimp/soc-2010-cage-2: 189/189] app: cage tool adjustments and fixes



commit 6dc2042fe2f4862e409b505b6bc690e79dc919e5
Author: Alexia Death <alexiadeath gmail com>
Date:   Mon Aug 30 23:36:20 2010 +0300

    app: cage tool adjustments and fixes
    
    Just show the complete preview and take the fill color from under first point.

 app/gegl/gimpcageconfig.c             |    2 +-
 app/gegl/gimpoperationcagetransform.c |   12 +++++-------
 app/tools/gimpcageoptions.c           |    2 +-
 app/tools/gimpcagetool.c              |   12 +++---------
 4 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/app/gegl/gimpcageconfig.c b/app/gegl/gimpcageconfig.c
index 8628dc3..99417f8 100644
--- a/app/gegl/gimpcageconfig.c
+++ b/app/gegl/gimpcageconfig.c
@@ -95,7 +95,7 @@ static void
 gimp_cage_config_init (GimpCageConfig *self)
 {
   self->cage_vertice_number = 0;
-  self->cage_vertices_max = 50; //pre-allocation for 50 vertices for the cage.
+  self->cage_vertices_max = 50; /*pre-allocation for 50 vertices for the cage.*/
 
   self->cage_vertices = g_new(GimpVector2, self->cage_vertices_max);
   self->cage_vertices_d = g_new(GimpVector2, self->cage_vertices_max);
diff --git a/app/gegl/gimpoperationcagetransform.c b/app/gegl/gimpoperationcagetransform.c
index c1a28f3..d8ac0c8 100644
--- a/app/gegl/gimpoperationcagetransform.c
+++ b/app/gegl/gimpoperationcagetransform.c
@@ -211,7 +211,11 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
   GimpVector2 p1_d, p2_d, p3_d, p4_d;
   GimpVector2 p1_s, p2_s, p3_s, p4_s;
   GimpVector2 plain_color;
-  gboolean plain_color_set = FALSE;
+
+  plain_color.x = (gint) config->cage_vertices[0].x;
+  plain_color.y = (gint) config->cage_vertices[0].y;
+
+  printf ("Color fill picked from (%f, %f)\n", plain_color.x, plain_color.y);
 
   /* pre-fill the out buffer with no-displacement coordinate */
   GeglBufferIterator *it = gegl_buffer_iterator_new (out_buf, roi, NULL, GEGL_BUFFER_WRITE);
@@ -229,12 +233,6 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
     {
       if (oct->fill_plain_color && gimp_cage_config_point_inside(config, x, y))
       {
-        if (!plain_color_set)
-        {
-          plain_color.x = x;
-          plain_color.y = y;
-          plain_color_set = TRUE;
-        }
         output[0] = plain_color.x;
         output[1] = plain_color.y;
       }
diff --git a/app/tools/gimpcageoptions.c b/app/tools/gimpcageoptions.c
index ecc3c07..e32c1e8 100644
--- a/app/tools/gimpcageoptions.c
+++ b/app/tools/gimpcageoptions.c
@@ -157,7 +157,7 @@ gimp_cage_options_gui (GimpToolOptions *tool_options)
 
 
   button = gimp_prop_check_button_new (config, "fill-plain-color",
-                                       _("Fill the original cage position with a plain color"));
+                                       _("Fill in background"));
   gtk_box_pack_start (GTK_BOX (vbox),  button, FALSE, FALSE, 0);
   gtk_widget_show (button);
   
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index a925e44..e2f6597 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -380,10 +380,6 @@ gimp_cage_tool_button_release (GimpTool              *tool,
 
     ct->idle_id = g_idle_add ((GSourceFunc) gimp_cage_tool_update_preview, tool);
 
-    gimp_projection_flush_now (gimp_image_get_projection (image));
-    gimp_display_flush_now (tool->display);
-
-
     gimp_draw_tool_resume (GIMP_DRAW_TOOL (ct));
   }
   ct->handle_moved = -1;
@@ -396,14 +392,12 @@ gimp_cage_tool_update_preview (GimpTool *tool)
   GimpCageTool *ct = GIMP_CAGE_TOOL (tool);
   GimpImage *image = gimp_display_get_image (tool->display);
 
-
-    gimp_projection_flush_now (gimp_image_get_projection (image));
-    gimp_display_flush_now (tool->display);
-
     if (!gimp_image_map_is_busy(ct->image_map))
       {
         ct->idle_id = 0;
-        printf ("Preview update complete\n");
+        printf ("Preview render complete, updating\n");
+        gimp_projection_flush_now (gimp_image_get_projection (image));
+        gimp_display_flush_now (tool->display);
 
         return FALSE;
       }



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