diff --git a/ChangeLog b/ChangeLog index b124688db9..da99ba8c66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-09-18 Simon Budig + + * app/tools/gimpvectortool.c: Cursor keys now move the currently + active anchors, SHIFT and CTRL increase the steps. + + * MAINTAINERS: Added myself in an attack of hubris... + 2003-09-18 Sven Neumann * app/vectors/gimpvectors-export.c: save the vectors (or rather diff --git a/MAINTAINERS b/MAINTAINERS index c109195dd8..ac9921123d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -188,3 +188,11 @@ expertise: i18n, French i18n, MMX current-work: not enough time to work on Gimp, ported forward my old code for MMX-accelerated paint_funcs commit access: yes +Name: Simon Budig +Email: simon@gimp.org +url: http://www.home.unix-ag.org/simon/gimp/ +ircnick: nomis +expertise: Path tool, Vectors stuff, Plug-Ins +current work: Path tool +commit access: yes + diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c index a54f596e95..dd823682ed 100644 --- a/app/tools/gimpvectortool.c +++ b/app/tools/gimpvectortool.c @@ -24,6 +24,7 @@ #include #include +#include #include "libgimpmath/gimpmath.h" #include "libgimpbase/gimpbase.h" @@ -48,6 +49,8 @@ #include "display/gimpdisplay.h" #include "display/gimpdisplay-foreach.h" +#include "display/gimpdisplayshell.h" +#include "display/gimpdisplayshell-scale.h" #include "gimptoolcontrol.h" #include "gimpvectoroptions.h" @@ -86,6 +89,9 @@ static void gimp_vector_tool_motion (GimpTool *tool, guint32 time, GdkModifierType state, GimpDisplay *gdisp); +static void gimp_vector_tool_arrow_key (GimpTool *tool, + GdkEventKey *kevent, + GimpDisplay *gdisp); static void gimp_vector_tool_modifier_key (GimpTool *tool, GdkModifierType key, gboolean press, @@ -186,6 +192,7 @@ gimp_vector_tool_class_init (GimpVectorToolClass *klass) tool_class->button_press = gimp_vector_tool_button_press; tool_class->button_release = gimp_vector_tool_button_release; tool_class->motion = gimp_vector_tool_motion; + tool_class->arrow_key = gimp_vector_tool_arrow_key; tool_class->modifier_key = gimp_vector_tool_modifier_key; tool_class->oper_update = gimp_vector_tool_oper_update; tool_class->cursor_update = gimp_vector_tool_cursor_update; @@ -704,6 +711,61 @@ gimp_vector_tool_motion (GimpTool *tool, gimp_vectors_thaw (vector_tool->vectors); } +static void +gimp_vector_tool_arrow_key (GimpTool *tool, + GdkEventKey *kevent, + GimpDisplay *gdisp) +{ + GimpVectorTool *vector_tool = GIMP_VECTOR_TOOL (tool); + GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool); + GimpDisplayShell *shell; + gdouble xdist, ydist; + gdouble pixels = 1.0; + + if (!vector_tool->vectors) + return; + + shell = GIMP_DISPLAY_SHELL (draw_tool->gdisp->shell); + + if (kevent->state & GDK_SHIFT_MASK) + pixels = 10.0; + + if (kevent->state & GDK_CONTROL_MASK) + pixels = 50.0; + + if (gdisp == draw_tool->gdisp) + { + 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_Left: + gimp_vector_tool_move_selected_anchors (vector_tool, -xdist, 0); + break; + case GDK_Right: + gimp_vector_tool_move_selected_anchors (vector_tool, xdist, 0); + break; + case GDK_Up: + gimp_vector_tool_move_selected_anchors (vector_tool, 0, -ydist); + break; + case GDK_Down: + gimp_vector_tool_move_selected_anchors (vector_tool, 0, ydist); + break; + default: + break; + } + gimp_vectors_thaw (vector_tool->vectors); + vector_tool->have_undo = FALSE; + + gimp_image_flush (gdisp->gimage); + } +} + static void gimp_vector_tool_modifier_key (GimpTool *tool, GdkModifierType key,