[gimp] app: Iscissors: allow to remove points with Control-Click
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: Iscissors: allow to remove points with Control-Click
- Date: Sat, 28 Mar 2015 21:42:11 +0000 (UTC)
commit f2c4b9317f69177bbe741c20a4dbfa943efcf9d1
Author: Michael Natterer <mitch gimp org>
Date: Sat Mar 28 22:41:43 2015 +0100
app: Iscissors: allow to remove points with Control-Click
app/tools/gimpiscissorstool.c | 65 +++++++++++++++++++++++++++++++----------
app/tools/gimpiscissorstool.h | 1 +
2 files changed, 50 insertions(+), 16 deletions(-)
---
diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c
index 5311db9..e2cb738 100644
--- a/app/tools/gimpiscissorstool.c
+++ b/app/tools/gimpiscissorstool.c
@@ -658,17 +658,34 @@ gimp_iscissors_tool_button_release (GimpTool *tool,
break;
case SEED_ADJUSTMENT:
- /* recalculate both segments */
- if (iscissors->segment1)
+ if (state & gimp_get_modify_selection_mask ())
{
- if (! options->interactive)
- calculate_segment (iscissors, iscissors->segment1);
- }
+ if (iscissors->segment1 && iscissors->segment2)
+ {
+ iscissors->segment1->x1 = iscissors->segment2->x1;
+ iscissors->segment1->y1 = iscissors->segment2->y1;
- if (iscissors->segment2)
+ g_queue_remove (iscissors->curve->segments,
+ iscissors->segment2);
+
+ calculate_segment (iscissors, iscissors->segment1);
+ }
+ }
+ else
{
- if (! options->interactive)
- calculate_segment (iscissors, iscissors->segment2);
+ /* recalculate both segments */
+
+ if (iscissors->segment1)
+ {
+ if (! options->interactive)
+ calculate_segment (iscissors, iscissors->segment1);
+ }
+
+ if (iscissors->segment2)
+ {
+ if (! options->interactive)
+ calculate_segment (iscissors, iscissors->segment2);
+ }
}
gimp_iscissors_tool_free_redo (iscissors);
@@ -910,14 +927,26 @@ gimp_iscissors_tool_oper_update (GimpTool *tool,
if (mouse_over_vertex (iscissors, coords->x, coords->y) > 1)
{
- gchar *status;
-
- status = gimp_suggest_modifiers (_("Click-Drag to move this point"),
- GDK_SHIFT_MASK & ~state,
- _("%s: disable auto-snap"), NULL, NULL);
- gimp_tool_replace_status (tool, display, "%s", status);
- g_free (status);
- iscissors->op = ISCISSORS_OP_MOVE_POINT;
+ GdkModifierType remove_mask = gimp_get_modify_selection_mask ();
+
+ if (state & remove_mask)
+ {
+ gimp_tool_replace_status (tool, display,
+ _("Click to remove this point"));
+ iscissors->op = ISCISSORS_OP_MOVE_POINT;
+ }
+ else
+ {
+ gchar *status =
+ gimp_suggest_modifiers (_("Click-Drag to move this point"),
+ (GDK_SHIFT_MASK | remove_mask) & ~state,
+ _("%s: disable auto-snap"),
+ _("%s: remove this point"),
+ NULL);
+ gimp_tool_replace_status (tool, display, "%s", status);
+ g_free (status);
+ iscissors->op = ISCISSORS_OP_MOVE_POINT;
+ }
}
else if (mouse_over_segment (iscissors, coords->x, coords->y))
{
@@ -1028,6 +1057,10 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool,
modifier = GIMP_CURSOR_MODIFIER_PLUS;
break;
+ case ISCISSORS_OP_REMOVE_POINT:
+ modifier = GIMP_CURSOR_MODIFIER_MINUS;
+ break;
+
case ISCISSORS_OP_CONNECT:
modifier = GIMP_CURSOR_MODIFIER_JOIN;
break;
diff --git a/app/tools/gimpiscissorstool.h b/app/tools/gimpiscissorstool.h
index a3bffa6..c2255b5 100644
--- a/app/tools/gimpiscissorstool.h
+++ b/app/tools/gimpiscissorstool.h
@@ -38,6 +38,7 @@ typedef enum
ISCISSORS_OP_SELECT,
ISCISSORS_OP_MOVE_POINT,
ISCISSORS_OP_ADD_POINT,
+ ISCISSORS_OP_REMOVE_POINT,
ISCISSORS_OP_CONNECT,
ISCISSORS_OP_IMPOSSIBLE
} IscissorsOps;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]