mirror of https://github.com/GNOME/gimp.git
app: Iscissors: allow to remove points with Control-Click
This commit is contained in:
parent
bd75ed6bf0
commit
f2c4b9317f
|
@ -658,7 +658,23 @@ gimp_iscissors_tool_button_release (GimpTool *tool,
|
|||
break;
|
||||
|
||||
case SEED_ADJUSTMENT:
|
||||
if (state & gimp_get_modify_selection_mask ())
|
||||
{
|
||||
if (iscissors->segment1 && iscissors->segment2)
|
||||
{
|
||||
iscissors->segment1->x1 = iscissors->segment2->x1;
|
||||
iscissors->segment1->y1 = iscissors->segment2->y1;
|
||||
|
||||
g_queue_remove (iscissors->curve->segments,
|
||||
iscissors->segment2);
|
||||
|
||||
calculate_segment (iscissors, iscissors->segment1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* recalculate both segments */
|
||||
|
||||
if (iscissors->segment1)
|
||||
{
|
||||
if (! options->interactive)
|
||||
|
@ -670,6 +686,7 @@ gimp_iscissors_tool_button_release (GimpTool *tool,
|
|||
if (! options->interactive)
|
||||
calculate_segment (iscissors, iscissors->segment2);
|
||||
}
|
||||
}
|
||||
|
||||
gimp_iscissors_tool_free_redo (iscissors);
|
||||
break;
|
||||
|
@ -910,15 +927,27 @@ gimp_iscissors_tool_oper_update (GimpTool *tool,
|
|||
|
||||
if (mouse_over_vertex (iscissors, coords->x, coords->y) > 1)
|
||||
{
|
||||
gchar *status;
|
||||
GdkModifierType remove_mask = gimp_get_modify_selection_mask ();
|
||||
|
||||
status = gimp_suggest_modifiers (_("Click-Drag to move this point"),
|
||||
GDK_SHIFT_MASK & ~state,
|
||||
_("%s: disable auto-snap"), NULL, NULL);
|
||||
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))
|
||||
{
|
||||
ISegment *segment = g_queue_peek_head (iscissors->curve->segments);
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue