Made the rectangle tool handles not resize during rectangle manipulation,

2007-07-14  Martin Nordholts  <martinn@svn.gnome.org>

	Made the rectangle tool handles not resize during rectangle
	manipulation, as outlined in the spec, by separating highlight
	updating and handle size updating calls.

	* app/tools/gimprectangletool.c (gimp_rectangle_tool_configure):
	Renamed to
	(gimp_rectangle_tool_update_handle_sizes): and moved
	gimp_rectangle_tool_set_highlight out of it. These two are now
	called independantly.

svn path=/trunk/; revision=22929
This commit is contained in:
Martin Nordholts
2007-07-14 16:03:13 +00:00
committed by Martin Nordholts
parent 82430afc70
commit 5b3f4ea658
3 changed files with 38 additions and 28 deletions

View File

@ -1,3 +1,15 @@
2007-07-14 Martin Nordholts <martinn@svn.gnome.org>
Made the rectangle tool handles not resize during rectangle
manipulation, as outlined in the spec, by separating highlight
updating and handle size updating calls.
* app/tools/gimprectangletool.c (gimp_rectangle_tool_configure):
Renamed to
(gimp_rectangle_tool_update_handle_sizes): and moved
gimp_rectangle_tool_set_highlight out of it. These two are now
called independantly.
2007-07-14 Martin Nordholts <martinn@svn.gnome.org> 2007-07-14 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangletool.c (gimp_rectangle_tool_clamp_width) * app/tools/gimprectangletool.c (gimp_rectangle_tool_clamp_width)
@ -112,7 +124,7 @@
Completely refactored. Completely refactored.
(gimp_rectangle_tool_active_modifier_key): (gimp_rectangle_tool_active_modifier_key):
(gimp_rectangle_tool_update_options): Submit to tool options. (gimp_rectangle_tool_synthesize_motion): Submit to tool options.
(gimp_rectangle_tool_apply_coord) (gimp_rectangle_tool_apply_coord)
(gimp_rectangle_tool_clamp) (gimp_rectangle_tool_clamp)

View File

@ -178,8 +178,12 @@ static void gimp_rectangle_tool_rectangle_changed (GimpRectangleTool *rectangl
static void gimp_rectangle_tool_auto_shrink (GimpRectangleTool *rectangle); static void gimp_rectangle_tool_auto_shrink (GimpRectangleTool *rectangle);
static GtkAnchorType gimp_rectangle_tool_get_anchor (GimpRectangleToolPrivate *private); static GtkAnchorType gimp_rectangle_tool_get_anchor (GimpRectangleToolPrivate *private);
static void gimp_rectangle_tool_set_highlight (GimpRectangleTool *rectangle);
static void gimp_rectangle_tool_set_highlight (GimpRectangleTool *rectangle);
static void gimp_rectangle_tool_update_handle_sizes (GimpRectangleTool *rectangle);
static void gimp_rectangle_tool_get_other_side (GimpRectangleTool *rectangle_tool, static void gimp_rectangle_tool_get_other_side (GimpRectangleTool *rectangle_tool,
const gchar **other_x, const gchar **other_x,
@ -535,7 +539,7 @@ gimp_rectangle_tool_control (GimpTool *tool,
break; break;
case GIMP_TOOL_ACTION_RESUME: case GIMP_TOOL_ACTION_RESUME:
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
break; break;
case GIMP_TOOL_ACTION_HALT: case GIMP_TOOL_ACTION_HALT:
@ -589,6 +593,8 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
"y2", y, "y2", y,
NULL); NULL);
gimp_rectangle_tool_update_handle_sizes (rectangle);
gimp_rectangle_tool_start (rectangle, display); gimp_rectangle_tool_start (rectangle, display);
} }
@ -802,6 +808,8 @@ gimp_rectangle_tool_button_release (GimpTool *tool,
gimp_tool_control_set_snap_offsets (tool->control, 0, 0, 0, 0); gimp_tool_control_set_snap_offsets (tool->control, 0, 0, 0, 0);
gimp_rectangle_tool_update_handle_sizes (rectangle);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
} }
@ -855,8 +863,8 @@ gimp_rectangle_tool_motion (GimpTool *tool,
current_x, current_x,
current_y); current_y);
/* recalculate the coordinates for rectangle_draw based on the new values */ /* Update the highlight. */
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
if (private->function != RECT_MOVING && if (private->function != RECT_MOVING &&
private->function != RECT_EXECUTING) private->function != RECT_EXECUTING)
@ -969,7 +977,7 @@ gimp_rectangle_tool_active_modifier_key (GimpTool *tool,
private->lastx, private->lastx,
private->lasty); private->lasty);
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
gimp_rectangle_tool_rectangle_changed (rectangle); gimp_rectangle_tool_rectangle_changed (rectangle);
} }
@ -993,8 +1001,7 @@ gimp_rectangle_tool_active_modifier_key (GimpTool *tool,
private->lastx, private->lastx,
private->lasty); private->lasty);
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
gimp_rectangle_tool_rectangle_changed (rectangle); gimp_rectangle_tool_rectangle_changed (rectangle);
@ -1010,12 +1017,10 @@ gimp_rectangle_tool_active_modifier_key (GimpTool *tool,
private->other_side_x, private->other_side_x,
private->other_side_y); private->other_side_y);
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
gimp_rectangle_tool_rectangle_changed (rectangle); gimp_rectangle_tool_rectangle_changed (rectangle);
} }
} }
gimp_draw_tool_resume (draw_tool); gimp_draw_tool_resume (draw_tool);
@ -1224,14 +1229,8 @@ gimp_rectangle_tool_key_press (GimpTool *tool,
private->center_x_on_fixed_center = (private->x1 + private->x2) / 2; private->center_x_on_fixed_center = (private->x1 + private->x2) / 2;
private->center_y_on_fixed_center = (private->y1 + private->y2) / 2; private->center_y_on_fixed_center = (private->y1 + private->y2) / 2;
/* g_object_set (rectangle, */ gimp_rectangle_tool_set_highlight (rectangle);
/* "x1", private->x1, */ gimp_rectangle_tool_update_handle_sizes (rectangle);
/* "y1", private->y1, */
/* "x2", private->x2, */
/* "y2", private->y2, */
/* NULL); */
gimp_rectangle_tool_configure (rectangle);
gimp_rectangle_tool_update_options (rectangle, tool->display); gimp_rectangle_tool_update_options (rectangle, tool->display);
@ -1620,7 +1619,7 @@ gimp_rectangle_tool_draw_guides (GimpDrawTool *draw_tool)
} }
void void
gimp_rectangle_tool_configure (GimpRectangleTool *rectangle) gimp_rectangle_tool_update_handle_sizes (GimpRectangleTool *rectangle)
{ {
GimpTool *tool = GIMP_TOOL (rectangle); GimpTool *tool = GIMP_TOOL (rectangle);
GimpRectangleToolPrivate *private; GimpRectangleToolPrivate *private;
@ -1636,8 +1635,6 @@ gimp_rectangle_tool_configure (GimpRectangleTool *rectangle)
if (! tool->display) if (! tool->display)
return; return;
gimp_rectangle_tool_set_highlight (rectangle);
shell = GIMP_DISPLAY_SHELL (tool->display->shell); shell = GIMP_DISPLAY_SHELL (tool->display->shell);
gimp_display_shell_transform_xy (shell, gimp_display_shell_transform_xy (shell,
@ -1648,7 +1645,6 @@ gimp_rectangle_tool_configure (GimpRectangleTool *rectangle)
private->x2, private->y2, private->x2, private->y2,
&dx2, &dy2, &dx2, &dy2,
FALSE); FALSE);
tw = dx2 - dx1; tw = dx2 - dx1;
th = dy2 - dy1; th = dy2 - dy1;
@ -1680,7 +1676,9 @@ gimp_rectangle_tool_start (GimpRectangleTool *rectangle,
GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (gimp_tool_get_options (tool)); GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (gimp_tool_get_options (tool));
tool->display = display; tool->display = display;
gimp_rectangle_tool_configure (rectangle);
gimp_rectangle_tool_set_highlight (rectangle);
gimp_rectangle_tool_update_handle_sizes (rectangle);
/* initialize the statusbar display */ /* initialize the statusbar display */
gimp_tool_push_status_coords (tool, tool->display, gimp_tool_push_status_coords (tool, tool->display,
@ -1754,7 +1752,7 @@ gimp_rectangle_tool_execute (GimpRectangleTool *rectangle)
private->x2 - private->x1, private->x2 - private->x1,
private->y2 - private->y1); private->y2 - private->y1);
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (rectangle)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (rectangle));
} }
@ -1858,7 +1856,8 @@ gimp_rectangle_tool_synthesize_motion (GimpRectangleTool *rectangle,
gimp_rectangle_tool_set_function (rectangle, old_function); gimp_rectangle_tool_set_function (rectangle, old_function);
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
gimp_rectangle_tool_update_handle_sizes (rectangle);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (rectangle)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (rectangle));
@ -2066,7 +2065,7 @@ gimp_rectangle_tool_auto_shrink (GimpRectangleTool *rectangle)
"y2", offset_y + shrunk_y2, "y2", offset_y + shrunk_y2,
NULL); NULL);
gimp_rectangle_tool_configure (rectangle); gimp_rectangle_tool_set_highlight (rectangle);
gimp_draw_tool_resume (GIMP_DRAW_TOOL (rectangle)); gimp_draw_tool_resume (GIMP_DRAW_TOOL (rectangle));
} }

View File

@ -122,7 +122,6 @@ void gimp_rectangle_tool_cursor_update (GimpTool *to
void gimp_rectangle_tool_draw (GimpDrawTool *draw); void gimp_rectangle_tool_draw (GimpDrawTool *draw);
gboolean gimp_rectangle_tool_execute (GimpRectangleTool *rect_tool); gboolean gimp_rectangle_tool_execute (GimpRectangleTool *rect_tool);
void gimp_rectangle_tool_cancel (GimpRectangleTool *rect_tool); void gimp_rectangle_tool_cancel (GimpRectangleTool *rect_tool);
void gimp_rectangle_tool_configure (GimpRectangleTool *rectangle);
void gimp_rectangle_tool_set_constraint (GimpRectangleTool *rectangle, void gimp_rectangle_tool_set_constraint (GimpRectangleTool *rectangle,
GimpRectangleConstraint constraint); GimpRectangleConstraint constraint);
GimpRectangleFunction gimp_rectangle_tool_get_function (GimpRectangleTool *rectangle); GimpRectangleFunction gimp_rectangle_tool_get_function (GimpRectangleTool *rectangle);