[gimp/soc-2009-siox-drb] 8.6



commit 4ebce14cfa8b7fef32c901c6adfac8b5dbea34a0
Author: Jie Ding <jieding src gnome org>
Date:   Thu Aug 6 02:26:22 2009 +0800

    8.6

 app/base/siox.c                      |   22 +++++-----------------
 app/tools/gimpforegroundselecttool.c |   25 ++++++++++++++++---------
 2 files changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/app/base/siox.c b/app/base/siox.c
index b55e12f..5a416c8 100644
--- a/app/base/siox.c
+++ b/app/base/siox.c
@@ -1432,22 +1432,10 @@ siox_drb (SioxState    *state,
     g_hash_table_foreach_remove(state->cache,siox_cache_remove_fg,NULL);
   if (optionsrefinement & SIOX_DRB_CHANGE_THRESHOLD)
     optionsrefinement = SIOX_DRB_RECALCULATE;
-  if (optionsrefinement & (SIOX_DRB_ADD |
-                           SIOX_DRB_SUBTRACT)) 
-    {
-      /*pixel_region_init (&srcPR, state->pixels,
-                          x - brush_radius, y - brush_radius, brush_radius * 2,
-                          brush_radius * 2, FALSE);
-      pixel_region_init (&mapPR, mask, x - brush_radius, y - brush_radius,
-                         brush_radius * 2, brush_radius * 2, TRUE);
-
-      pixel_region_init (&srcPR, state->pixels,
-                         x , y , brush_radius * 2, brush_radius * 2, FALSE);
-      pixel_region_init (&mapPR, mask, x, y,
-                         brush_radius * 2,
-                         brush_radius * 2, TRUE);
-      */	 
-	
+//  if (optionsrefinement & (SIOX_DRB_ADD |
+//                           SIOX_DRB_SUBTRACT)) 
+//    {
+    	 
       pixel_region_init (&srcPR, state->pixels,
                          x , y , state->width, state->height, FALSE);
       pixel_region_init (&mapPR, mask, x, y,
@@ -1533,7 +1521,7 @@ siox_drb (SioxState    *state,
               map += mapPR.rowstride;
             }
         }
-    }
+    //}
 }
 
 /**
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index 763f67a..48b6705 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -119,7 +119,8 @@ static void   gimp_foreground_select_tool_apply    (GimpForegroundSelectTool *fg
                                                     GimpDisplay              *display);
 
 static void   gimp_foreground_select_tool_stroke   (GimpChannel              *mask,
-                                                    FgSelectStroke           *stroke);
+                                                    FgSelectStroke           *stroke,
+                                                    gboolean                  drb);
 
 static void   gimp_foreground_select_tool_push_stroke (GimpForegroundSelectTool    *fg_select,
                                                        GimpDisplay                 *display,
@@ -764,10 +765,10 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
       /*  apply foreground and background markers  */
       if (!options->drb) 
         for (list = fg_select->strokes; list; list = list->next)
-          gimp_foreground_select_tool_stroke (mask, list->data);
+          gimp_foreground_select_tool_stroke (mask, list->data, FALSE);
       else if (options->drb)
 	for (drblist = fg_select->drbsignals; drblist; drblist = drblist->next)
-          gimp_foreground_select_tool_stroke (mask, drblist->data);
+          gimp_foreground_select_tool_stroke (mask, drblist->data, TRUE);
 			
       if (fg_select->state)
 	{
@@ -890,7 +891,8 @@ gimp_foreground_select_tool_apply (GimpForegroundSelectTool *fg_select,
 
 static void
 gimp_foreground_select_tool_stroke (GimpChannel    *mask,
-                                    FgSelectStroke *stroke)
+                                    FgSelectStroke *stroke,
+                                    gboolean        drb)
 {
   GimpScanConvert *scan_convert = gimp_scan_convert_new ();
 
@@ -911,15 +913,20 @@ gimp_foreground_select_tool_stroke (GimpChannel    *mask,
                                       stroke->num_points, stroke->points,
                                       FALSE);
     }
-
+  
   gimp_scan_convert_stroke (scan_convert,
                             stroke->width,
                             GIMP_JOIN_ROUND, GIMP_CAP_ROUND, 10.0,
                             0.0, NULL);
-
-   gimp_scan_convert_compose_value (scan_convert,
-                                    gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
-                                    0, 0, stroke->background ? 0 : 255);
+  if (!drb)
+    gimp_scan_convert_compose_value (scan_convert,
+                                     gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
+                                     0, 0, stroke->background ? 0 : 255);
+     
+  else
+    gimp_scan_convert_compose_value (scan_convert,
+                                     gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
+                                     0, 0, stroke->refinement ? 255 : 255);	
 	
   gimp_scan_convert_free (scan_convert);
 }



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