[gimp] app: FG select: implement canceling the current stroke (right mouse button)



commit e1383332044ac03a2826382f6fd51ace04cecef1
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 17 01:46:32 2014 +0200

    app: FG select: implement canceling the current stroke (right mouse button)

 app/tools/gimpforegroundselecttool.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index c793836..e757367 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -520,12 +520,20 @@ gimp_foreground_select_tool_button_release (GimpTool              *tool,
 
       gimp_tool_control_halt (tool->control);
 
-      gimp_foreground_select_tool_stroke_paint (fg_select, display, options);
-
-      if (fg_select->state == MATTING_STATE_PREVIEW_MASK)
-        gimp_foreground_select_tool_preview (fg_select, display);
+      if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
+        {
+          g_array_free (fg_select->stroke, TRUE);
+          fg_select->stroke = NULL;
+        }
       else
-        gimp_foreground_select_tool_set_trimap (fg_select, display);
+        {
+          gimp_foreground_select_tool_stroke_paint (fg_select, display, options);
+
+          if (fg_select->state == MATTING_STATE_PREVIEW_MASK)
+            gimp_foreground_select_tool_preview (fg_select, display);
+          else
+            gimp_foreground_select_tool_set_trimap (fg_select, display);
+        }
 
       gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
     }


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