Commit 3e74368a authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

return FALSE if the keypress event isn't handled because of a display

2005-07-19  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpvectortool.c (gimp_vector_tool_key_press): return
	FALSE if the keypress event isn't handled because of a display
	mismatch.
parent f56ab4b8
2005-07-19 Sven Neumann <sven@gimp.org>
* app/tools/gimpvectortool.c (gimp_vector_tool_key_press): return
FALSE if the keypress event isn't handled because the display
doesn't match.
2005-07-19 Sven Neumann <sven@gimp.org> 2005-07-19 Sven Neumann <sven@gimp.org>
* plug-ins/common/mng.c (mng_save_image): fixed signedness warnings. * plug-ins/common/mng.c (mng_save_image): fixed signedness warnings.
......
...@@ -794,6 +794,9 @@ gimp_vector_tool_key_press (GimpTool *tool, ...@@ -794,6 +794,9 @@ gimp_vector_tool_key_press (GimpTool *tool,
if (! vector_tool->vectors) if (! vector_tool->vectors)
return FALSE; return FALSE;
if (gdisp != draw_tool->gdisp)
return FALSE;
shell = GIMP_DISPLAY_SHELL (draw_tool->gdisp->shell); shell = GIMP_DISPLAY_SHELL (draw_tool->gdisp->shell);
if (kevent->state & GDK_SHIFT_MASK) if (kevent->state & GDK_SHIFT_MASK)
...@@ -802,72 +805,69 @@ gimp_vector_tool_key_press (GimpTool *tool, ...@@ -802,72 +805,69 @@ gimp_vector_tool_key_press (GimpTool *tool,
if (kevent->state & GDK_CONTROL_MASK) if (kevent->state & GDK_CONTROL_MASK)
pixels = 50.0; pixels = 50.0;
if (gdisp == draw_tool->gdisp) switch (kevent->keyval)
{ {
switch (kevent->keyval) case GDK_KP_Enter:
{ case GDK_Return:
case GDK_KP_Enter: gimp_vector_tool_to_selection_extended (vector_tool, kevent->state);
case GDK_Return: break;
gimp_vector_tool_to_selection_extended (vector_tool, kevent->state);
break;
case GDK_BackSpace:
case GDK_Delete:
gimp_vector_tool_delete_selected_anchors (vector_tool);
break;
case GDK_Left:
case GDK_Right:
case GDK_Up:
case GDK_Down:
xdist = FUNSCALEX (shell, pixels);
ydist = FUNSCALEY (shell, pixels);
gimp_vector_tool_undo_push (vector_tool, _("Move Anchors"));
gimp_vectors_freeze (vector_tool->vectors);
switch (kevent->keyval) case GDK_BackSpace:
{ case GDK_Delete:
case GDK_Left: gimp_vector_tool_delete_selected_anchors (vector_tool);
gimp_vector_tool_move_selected_anchors (vector_tool, -xdist, 0); break;
break;
case GDK_Right: case GDK_Left:
gimp_vector_tool_move_selected_anchors (vector_tool, xdist, 0); case GDK_Right:
break; case GDK_Up:
case GDK_Down:
xdist = FUNSCALEX (shell, pixels);
ydist = FUNSCALEY (shell, pixels);
case GDK_Up: gimp_vector_tool_undo_push (vector_tool, _("Move Anchors"));
gimp_vector_tool_move_selected_anchors (vector_tool, 0, -ydist);
break;
case GDK_Down: gimp_vectors_freeze (vector_tool->vectors);
gimp_vector_tool_move_selected_anchors (vector_tool, 0, ydist);
break;
default: switch (kevent->keyval)
break; {
} case GDK_Left:
gimp_vector_tool_move_selected_anchors (vector_tool, -xdist, 0);
break;
gimp_vectors_thaw (vector_tool->vectors); case GDK_Right:
vector_tool->have_undo = FALSE; gimp_vector_tool_move_selected_anchors (vector_tool, xdist, 0);
break; break;
case GDK_Escape: case GDK_Up:
options = GIMP_VECTOR_OPTIONS (tool->tool_info->tool_options); gimp_vector_tool_move_selected_anchors (vector_tool, 0, -ydist);
break;
if (options->edit_mode != GIMP_VECTOR_MODE_DESIGN) case GDK_Down:
g_object_set (options, "vectors-edit-mode", gimp_vector_tool_move_selected_anchors (vector_tool, 0, ydist);
GIMP_VECTOR_MODE_DESIGN, NULL);
break; break;
default: default:
return FALSE; break;
} }
gimp_image_flush (gdisp->gimage); gimp_vectors_thaw (vector_tool->vectors);
vector_tool->have_undo = FALSE;
break;
case GDK_Escape:
options = GIMP_VECTOR_OPTIONS (tool->tool_info->tool_options);
if (options->edit_mode != GIMP_VECTOR_MODE_DESIGN)
g_object_set (options, "vectors-edit-mode",
GIMP_VECTOR_MODE_DESIGN, NULL);
break;
default:
return FALSE;
} }
gimp_image_flush (gdisp->gimage);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment