[gimp/soc-2011-warp: 11/18] gimpwarptool: don't draw the effect size if under 3.0, to avoid warning/crash



commit 28efe405850620f3da0627415c4f037296691046
Author: Michael Muré <batolettre gmail com>
Date:   Fri Jun 3 21:43:16 2011 +0200

    gimpwarptool: don't draw the effect size if under 3.0, to avoid warning/crash

 app/tools/gimpwarptool.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/app/tools/gimpwarptool.c b/app/tools/gimpwarptool.c
index 52563c1..8078229 100644
--- a/app/tools/gimpwarptool.c
+++ b/app/tools/gimpwarptool.c
@@ -349,7 +349,6 @@ gimp_warp_tool_button_press (GimpTool            *tool,
                              GimpDisplay         *display)
 {
   GimpWarpTool    *wt        = GIMP_WARP_TOOL (tool);
-  GimpDrawTool    *draw_tool = GIMP_DRAW_TOOL (tool);
 
   if (display != tool->display)
     gimp_warp_tool_start (wt, display);
@@ -408,13 +407,16 @@ gimp_warp_tool_draw (GimpDrawTool *draw_tool)
   GimpWarpTool    *wt        = GIMP_WARP_TOOL (draw_tool);
   GimpWarpOptions *options   = GIMP_WARP_TOOL_GET_OPTIONS (wt);
 
-  gimp_draw_tool_add_handle (draw_tool,
-                             GIMP_HANDLE_CIRCLE,
-                             wt->cursor_x,
-                             wt->cursor_y,
-                             options->effect_size,
-                             options->effect_size,
-                             GIMP_HANDLE_ANCHOR_CENTER);
+  if (options->effect_size >= 3.0)
+    {
+      gimp_draw_tool_add_handle (draw_tool,
+                                 GIMP_HANDLE_CIRCLE,
+                                 wt->cursor_x,
+                                 wt->cursor_y,
+                                 options->effect_size,
+                                 options->effect_size,
+                                 GIMP_HANDLE_ANCHOR_CENTER);
+    }
 }
 
 static void



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