[gimp] Cage tool: in cage mode,	remove selected handles when hitting backspace
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gimp] Cage tool: in cage mode,	remove selected handles when hitting backspace
- Date: Mon,  2 May 2011 22:47:11 +0000 (UTC)
commit cc247b3e6660e7ac9db0994ab4da1f7956388073
Author: Michael Muré <batolettre gmail com>
Date:   Thu Apr 21 11:44:47 2011 +0200
    Cage tool: in cage mode, remove selected handles when hitting backspace
 app/tools/gimpcagetool.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index ee3b882..8c6d5b9 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -398,7 +398,17 @@ gimp_cage_tool_key_press (GimpTool    *tool,
     {
     case GDK_KEY_BackSpace:
       if (! ct->cage_complete && ct->tool_state == CAGE_STATE_WAIT)
-        gimp_cage_tool_remove_last_handle (ct);
+        {
+          gimp_cage_tool_remove_last_handle (ct);
+        }
+      else if (ct->cage_complete && ct->tool_state == CAGE_STATE_WAIT)
+        {
+          gimp_cage_config_remove_selected_points(ct->config);
+
+          /* if the cage have less than 3 handles, we reopen it */
+          if (gimp_cage_config_get_n_points(ct->config) <= 2)
+            ct->cage_complete = FALSE;
+        }
       return TRUE;
 
     case GDK_KEY_Return:
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]