[gimp/soc-2013-combined-selection-tool: 191/230] app:Solved Bug; switch case goes to default



commit d527497753e400c93361dc5a8a9755e598852e0c
Author: Ajay Ramanathan <ajay 010293 gmail com>
Date:   Wed Jun 26 01:55:57 2013 +0530

    app:Solved Bug; switch case goes to default

 app/tools/gimpselectbyshapetool.c |   43 +++++++++++++++++++++++++++++++------
 1 files changed, 36 insertions(+), 7 deletions(-)
---
diff --git a/app/tools/gimpselectbyshapetool.c b/app/tools/gimpselectbyshapetool.c
index f70c1e8..bd0537a 100644
--- a/app/tools/gimpselectbyshapetool.c
+++ b/app/tools/gimpselectbyshapetool.c
@@ -126,19 +126,20 @@ gimp_select_by_shape_tool_select (GimpRectangleSelectTool *rect_tool,
   GimpImage                  *image   = gimp_display_get_image (tool->display);
   GimpRectangleSelectOptions *sel_options     = GIMP_RECTANGLE_SELECT_TOOL_GET_OPTIONS (tool);
 
-  if(sel_options->shape_type == GIMP_SHAPE_RECTANGLE)
+  switch(sel_options->shape_type)
    {
-     gimp_channel_select_rectangle (gimp_image_get_mask (image),
+     case GIMP_SHAPE_RECTANGLE :
+      gimp_channel_select_rectangle (gimp_image_get_mask (image),
                                      x, y, w, h,
                                      operation,
                                      options->feather,
                                      options->feather_radius,
                                      options->feather_radius,
                                      TRUE);
-   }
-   else 
-   {   
-     gimp_channel_select_ellipse (gimp_image_get_mask (image),
+      break;
+    
+     case GIMP_SHAPE_ELLIPSE :  
+      gimp_channel_select_ellipse (gimp_image_get_mask (image),
                                    x, y, w, h,
                                    operation,
                                    options->antialias,
@@ -146,5 +147,33 @@ gimp_select_by_shape_tool_select (GimpRectangleSelectTool *rect_tool,
                                    options->feather_radius,
                                    options->feather_radius,
                                    TRUE);
-   }  
+      break;
+    
+     case GIMP_SHAPE_ROUNDED_RECT :
+      {
+       gdouble max    = MIN (w / 2.0, h / 2.0);
+       gdouble radius = MIN (sel_options->corner_radius, max);
+
+       gimp_channel_select_round_rect (gimp_image_get_mask (image),
+                                      x, y, w, h,
+                                      radius, 
+                                      radius,
+                                      operation,
+                                      options->antialias,
+                                      options->feather,
+                                      options->feather_radius,
+                                      options->feather_radius,
+                                      TRUE);
+       break;
+     }
+      default :
+       gimp_channel_select_rectangle (gimp_image_get_mask (image),
+                                     x, y, w, h,
+                                     operation,
+                                     options->feather,
+                                     options->feather_radius,
+                                     options->feather_radius,
+                                     TRUE);
+       break;
+   } 
 }


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