From df22da37fdfbd0057a53253919711373123fdf80 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 14 Apr 2008 12:56:25 +0000 Subject: [PATCH] formatting. 2008-04-14 Sven Neumann * app/tools/gimppolygonselecttool.c: formatting. svn path=/trunk/; revision=25486 --- ChangeLog | 4 ++++ app/tools/gimppolygonselecttool.c | 28 +++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index d12d85c726..a8f8f6e97f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-14 Sven Neumann + + * app/tools/gimppolygonselecttool.c: formatting. + 2008-04-14 Michael Natterer * app/tools/gimppolygonselecttool.c diff --git a/app/tools/gimppolygonselecttool.c b/app/tools/gimppolygonselecttool.c index f1bc166464..02a9e84203 100644 --- a/app/tools/gimppolygonselecttool.c +++ b/app/tools/gimppolygonselecttool.c @@ -254,9 +254,8 @@ gimp_polygon_select_tool_oper_update (GimpTool *tool, display, coords); - hovering_first_point = gimp_polygon_select_tool_should_close (poly_sel_tool, - display, - coords); + hovering_first_point = + gimp_polygon_select_tool_should_close (poly_sel_tool, display, coords); gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); @@ -407,7 +406,8 @@ gimp_polygon_select_tool_button_release (GimpTool *tool, else { /* Otherwise, clear the selection mask */ - gimp_channel_clear (gimp_image_get_mask (display->image), NULL, TRUE); + gimp_channel_clear (gimp_image_get_mask (display->image), + NULL, TRUE); } gimp_image_flush (display->image); @@ -566,7 +566,9 @@ static void gimp_polygon_select_tool_real_select (GimpPolygonSelectTool *poly_sel_tool, GimpDisplay *display) { - GimpSelectionOptions *options = GIMP_SELECTION_TOOL_GET_OPTIONS (poly_sel_tool); + GimpSelectionOptions *options; + + options = GIMP_SELECTION_TOOL_GET_OPTIONS (poly_sel_tool); gimp_channel_select_polygon (gimp_image_get_mask (display->image), Q_("command|Polygon Select"), @@ -590,7 +592,8 @@ gimp_polygon_select_tool_add_point (GimpPolygonSelectTool *poly_sel_tool, poly_sel_tool->max_segs += DEFAULT_MAX_INC; poly_sel_tool->points = g_realloc (poly_sel_tool->points, - sizeof (GimpVector2) * poly_sel_tool->max_segs); + sizeof (GimpVector2) * + poly_sel_tool->max_segs); } poly_sel_tool->points[poly_sel_tool->n_points].x = x; @@ -631,7 +634,7 @@ gimp_polygon_select_tool_select_closest_point (GimpPolygonSelectTool *poly_sel_t GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (poly_sel_tool); gdouble shortest_dist = POINT_GRAB_THRESHOLD_SQ; GimpVector2 *grabbed_point = NULL; - int i; + gint i; for (i = 0; i < poly_sel_tool->n_points; i++) { @@ -665,21 +668,20 @@ gimp_polygon_select_tool_should_close (GimpPolygonSelectTool *poly_sel_tool, GimpDisplay *display, GimpCoords *coords) { - gboolean should_close = FALSE; - if (poly_sel_tool->n_points > 0) { - gdouble dist; + GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (poly_sel_tool); + gdouble dist; - dist = gimp_draw_tool_calc_distance_square (GIMP_DRAW_TOOL (poly_sel_tool), + dist = gimp_draw_tool_calc_distance_square (draw_tool, display, coords->x, coords->y, poly_sel_tool->points[0].x, poly_sel_tool->points[0].y); - should_close = dist < POINT_GRAB_THRESHOLD_SQ; + return (dist < POINT_GRAB_THRESHOLD_SQ); } - return should_close; + return FALSE; }