[gimp] app: remove gimp_draw_tool_in_radius()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: remove gimp_draw_tool_in_radius()
- Date: Sat, 25 Sep 2010 16:25:32 +0000 (UTC)
commit 5089b9a706c8a54732f0d46791cd8ec354a6df1b
Author: Michael Natterer <mitch gimp org>
Date: Sat Sep 25 18:24:38 2010 +0200
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 c4ab08a..2512248 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -372,34 +372,6 @@ gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_tool,
}
/**
- * 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
* @x1: start point X in image coordinates
diff --git a/app/tools/gimpdrawtool.h b/app/tools/gimpdrawtool.h
index 4a473c4..37d3e40 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 ab61f4b..078a60b 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]