[gimp] Bug 741352: Cage tool crashes pressing Enter after Esc



commit af64a104c39551534ac9c90bd8b6c624502e95d7
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Thu Dec 11 18:37:49 2014 +0100

    Bug 741352: Cage tool crashes pressing Enter after Esc

 app/tools/gimpcagetool.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index 2996da8..cd5ce5c 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -370,12 +370,16 @@ gimp_cage_tool_key_press (GimpTool    *tool,
 {
   GimpCageTool *ct = GIMP_CAGE_TOOL (tool);
 
+  if (! ct->config)
+    return FALSE;
+
   switch (kevent->keyval)
     {
     case GDK_KEY_BackSpace:
       if (ct->tool_state == CAGE_STATE_WAIT)
         {
-          gimp_cage_tool_remove_last_handle (ct);
+          if (gimp_cage_config_get_n_points(ct->config) != 0)
+            gimp_cage_tool_remove_last_handle (ct);
         }
       else if (ct->tool_state == DEFORM_STATE_WAIT)
         {
@@ -931,6 +935,7 @@ gimp_cage_tool_halt (GimpCageTool *ct)
     }
 
   tool->display = NULL;
+  ct->tool_state = CAGE_STATE_INIT;
 
   g_object_set (gimp_tool_get_options (tool),
                 "cage-mode", GIMP_CAGE_MODE_CAGE_CHANGE,


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