Bill Skaggs <weskaggs@primate.ucdavis.edu>

* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]: put back code for responding
	to modifiers pressed after mouse1-down, at mitch's request.
This commit is contained in:
William Skaggs 2006-09-23 22:32:35 +00:00
parent c2c8c8805b
commit 0b005ffe99
5 changed files with 103 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2006-09-23 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpcroptool.c
* app/tools/gimprectangleselecttool.c
* app/tools/gimprectangletool.[ch]: put back code for responding
to modifiers pressed after mouse1-down, at mitch's request.
2006-09-23 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimprectangleselecttool.c

View File

@ -64,6 +64,11 @@ static void gimp_crop_tool_button_release (GimpTool *tool,
guint32 time,
GdkModifierType state,
GimpDisplay *display);
static void gimp_crop_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_crop_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
@ -124,6 +129,7 @@ gimp_crop_tool_class_init (GimpCropToolClass *klass)
tool_class->button_release = gimp_crop_tool_button_release;
tool_class->motion = gimp_rectangle_tool_motion;
tool_class->key_press = gimp_rectangle_tool_key_press;
tool_class->active_modifier_key = gimp_crop_tool_active_modifier_key;
tool_class->oper_update = gimp_rectangle_tool_oper_update;
tool_class->cursor_update = gimp_crop_tool_cursor_update;
@ -238,6 +244,19 @@ gimp_crop_tool_button_release (GimpTool *tool,
gimp_rectangle_tool_button_release (tool, coords, time, state, display);
}
static void
gimp_crop_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display)
{
GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool, key, press, state,
display);
gimp_rectangle_tool_active_modifier_key (tool, key, press, state, display);
}
static void
gimp_crop_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,

View File

@ -78,6 +78,11 @@ static void gimp_rect_select_tool_button_release (GimpTool *to
guint32 time,
GdkModifierType state,
GimpDisplay *display);
static void gimp_rect_select_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_rect_select_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
@ -154,6 +159,7 @@ gimp_rect_select_tool_class_init (GimpRectSelectToolClass *klass)
tool_class->button_release = gimp_rect_select_tool_button_release;
tool_class->motion = gimp_rectangle_tool_motion;
tool_class->key_press = gimp_rectangle_tool_key_press;
tool_class->active_modifier_key = gimp_rect_select_tool_active_modifier_key;
tool_class->oper_update = gimp_rect_select_tool_oper_update;
tool_class->cursor_update = gimp_rect_select_tool_cursor_update;
@ -375,6 +381,19 @@ gimp_rect_select_tool_button_release (GimpTool *tool,
rect_select->redo = NULL;
}
static void
gimp_rect_select_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display)
{
GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool, key, press, state,
display);
gimp_rectangle_tool_active_modifier_key (tool, key, press, state, display);
}
static void
gimp_rect_select_tool_oper_update (GimpTool *tool,
GimpCoords *coords,

View File

@ -1179,6 +1179,59 @@ gimp_rectangle_tool_motion (GimpTool *tool,
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
}
void
gimp_rectangle_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display)
{
GimpRectangleTool *rectangle = GIMP_RECTANGLE_TOOL (tool);
GimpRectangleOptions *options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool);
if (key == GDK_SHIFT_MASK)
{
gboolean fixed_aspect;
g_object_get (options,
"fixed-aspect", &fixed_aspect,
NULL);
g_object_set (options,
"fixed-aspect", ! fixed_aspect,
NULL);
}
if (key == GDK_CONTROL_MASK)
{
gboolean fixed_center;
g_object_get (options,
"fixed-center", &fixed_center,
NULL);
g_object_set (options,
"fixed-center", ! fixed_center,
NULL);
if (! fixed_center)
{
gint pressx, pressy;
gdouble center_x, center_y;
gimp_rectangle_tool_get_press_coords (rectangle, &pressx, &pressy);
center_x = pressx;
center_y = pressy;
g_object_set (options,
"center-x", center_x,
"center-y", center_y,
NULL);
}
}
}
/*
* gimp_rectangle_tool_check_function() is needed to deal with
* situations where the user drags a corner or edge across one of the

View File

@ -108,6 +108,11 @@ void gimp_rectangle_tool_motion (GimpTool *to
gboolean gimp_rectangle_tool_key_press (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *display);
void gimp_rectangle_tool_active_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
void gimp_rectangle_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,