app: GimpColorTool and GimpMoveTool: don't start the draw tool twice

and some minor coding style cleanup.
This commit is contained in:
Michael Natterer 2011-04-04 19:20:04 +02:00
parent ac9b487795
commit 7d39d800fc
2 changed files with 9 additions and 10 deletions

View File

@ -221,7 +221,8 @@ gimp_color_tool_button_press (GimpTool *tool,
gimp_display_shell_selection_pause (shell);
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
if (! gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tool)))
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
gimp_tool_push_status_coords (tool, display,
gimp_tool_control_get_precision (tool->control),
@ -432,12 +433,11 @@ gimp_color_tool_oper_update (GimpTool *tool,
GimpImage *image = gimp_display_get_image (display);
GimpSamplePoint *sample_point = NULL;
if (color_tool->enabled &&
gimp_display_shell_get_show_sample_points (shell) && proximity)
if (color_tool->enabled &&
gimp_display_shell_get_show_sample_points (shell) &&
proximity)
{
gint snap_distance;
snap_distance = GIMP_DISPLAY_CONFIG (display->gimp->config)->snap_distance;
gint snap_distance = display->config->snap_distance;
sample_point =
gimp_image_find_sample_point (image,
@ -566,8 +566,6 @@ gimp_color_tool_draw (GimpDrawTool *draw_tool)
2 * radius + 1);
}
}
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
}
static gboolean

View File

@ -239,7 +239,8 @@ gimp_move_tool_button_press (GimpTool *tool,
gimp_display_shell_selection_pause (shell);
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
if (! gimp_draw_tool_is_active (GIMP_DRAW_TOOL (tool)))
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), display);
gimp_tool_push_status_length (tool, display,
_("Move Guide: "),
@ -626,7 +627,7 @@ gimp_move_tool_oper_update (GimpTool *tool,
gimp_display_shell_get_show_guides (shell) &&
proximity)
{
const gint snap_distance = display->config->snap_distance;
gint snap_distance = display->config->snap_distance;
guide = gimp_image_find_guide (image, coords->x, coords->y,
FUNSCALEX (shell, snap_distance),