From 5089b9a706c8a54732f0d46791cd8ec354a6df1b Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 25 Sep 2010 18:24:38 +0200 Subject: [PATCH] app: remove gimp_draw_tool_in_radius() It was used only once and that code is not less readable when using gimp_draw_tool_calc_distance_square(). --- app/tools/gimpdrawtool.c | 28 ---------------------------- app/tools/gimpdrawtool.h | 7 ------- app/tools/gimpiscissorstool.c | 9 ++++----- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index c4ab08afda..2512248df1 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -371,34 +371,6 @@ gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_tool, return SQR (tx2 - tx1) + SQR (ty2 - ty1); } -/** - * gimp_draw_tool_in_radius: - * @draw_tool: a #GimpDrawTool - * @display: a #GimpDisplay - * @x1: start point X in image coordinates - * @y1: start point Y in image coordinates - * @x2: end point X in image coordinates - * @y2: end point Y in image coordinates - * @radius: distance in screen coordinates, not image coordinates - * - * The points are in image space coordinates. - * - * Returns: %TRUE if the points are within radius of each other, - * %FALSE otherwise - **/ -gboolean -gimp_draw_tool_in_radius (GimpDrawTool *draw_tool, - GimpDisplay *display, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2, - gint radius) -{ - return (gimp_draw_tool_calc_distance_square (draw_tool, display, - x1, y1, x2, y2) < SQR (radius)); -} - /** * gimp_draw_tool_draw_line: * @draw_tool: the #GimpDrawTool diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h index 4a473c4b1a..37d3e40f4f 100644 --- a/app/tools/gimpdrawtool.h +++ b/app/tools/gimpdrawtool.h @@ -81,13 +81,6 @@ gdouble gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_too gdouble y1, gdouble x2, gdouble y2); -gboolean gimp_draw_tool_in_radius (GimpDrawTool *draw_tool, - GimpDisplay *display, - gdouble x1, - gdouble y1, - gdouble x2, - gdouble y2, - gint radius); GimpCanvasItem * gimp_draw_tool_draw_line (GimpDrawTool *draw_tool, gdouble x1, diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index ab61f4bbce..078a60bd56 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -1299,11 +1299,10 @@ mouse_over_curve (GimpIscissorsTool *iscissors, ty = coords >> 16; /* Is the specified point close enough to the curve? */ - if (gimp_draw_tool_in_radius (GIMP_DRAW_TOOL (iscissors), - GIMP_TOOL (iscissors)->display, - tx, ty, - x, y, - POINT_WIDTH / 2)) + if (gimp_draw_tool_calc_distance_square (GIMP_DRAW_TOOL (iscissors), + GIMP_TOOL (iscissors)->display, + tx, ty, + x, y) < SQR (POINT_WIDTH / 2)) { return list; }