mirror of https://github.com/GNOME/gimp.git
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().
This commit is contained in:
parent
dfd5a265eb
commit
5089b9a706
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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),
|
||||
if (gimp_draw_tool_calc_distance_square (GIMP_DRAW_TOOL (iscissors),
|
||||
GIMP_TOOL (iscissors)->display,
|
||||
tx, ty,
|
||||
x, y,
|
||||
POINT_WIDTH / 2))
|
||||
x, y) < SQR (POINT_WIDTH / 2))
|
||||
{
|
||||
return list;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue