[gimp/gimp-2-8] Bug 741352: Cage tool crashes pressing Enter after Esc



commit cd9e8785548d68509d7579781486f227d2aa9a56
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
    
    (cherry picked from commit af64a104c39551534ac9c90bd8b6c624502e95d7)
    
    Conflicts:
        app/tools/gimpcagetool.c

 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 a85c19f..b8eeb05 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -256,6 +256,7 @@ gimp_cage_tool_control (GimpTool       *tool,
         }
 
       tool->display = NULL;
+      ct->tool_state = CAGE_STATE_INIT;
 
       g_object_set (gimp_tool_get_options (tool),
                     "cage-mode", GIMP_CAGE_MODE_CAGE_CHANGE,
@@ -403,12 +404,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)
         {


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