Commit cb777787 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig
Browse files

renamed gimp_coords_length2 to gimp_coords_length_squared.

2004-06-09  Simon Budig  <simon@gimp.org>

	* app/core/gimpcoords.[ch]: renamed gimp_coords_length2 to
	gimp_coords_length_squared.

	* app/vectors/gimpbezierstroke.c: Changed accordingly
parent 084d57c4
2004-06-09 Simon Budig <simon@gimp.org>
* app/core/gimpcoords.[ch]: renamed gimp_coords_length2 to
gimp_coords_length_squared.
* app/vectors/gimpbezierstroke.c: Changed accordingly
2004-06-09 Sven Neumann <sven@gimp.org>
* app/tools/gimppenciltool.c (gimp_pencil_tool_init): no need to
......
......@@ -127,7 +127,7 @@ gimp_coords_scalarprod (const GimpCoords *a,
*/
gdouble
gimp_coords_length2 (const GimpCoords *a)
gimp_coords_length_squared (const GimpCoords *a)
{
GimpCoords upscaled_a;
......@@ -145,7 +145,7 @@ gimp_coords_length2 (const GimpCoords *a)
gdouble
gimp_coords_length (const GimpCoords *a)
{
return sqrt (gimp_coords_length2 (a));
return sqrt (gimp_coords_length_squared (a));
}
gboolean
......
......@@ -23,31 +23,31 @@
#define __GIMP_COORDS_H__
void gimp_coords_mix (const gdouble amul,
const GimpCoords *a,
const gdouble bmul,
const GimpCoords *b,
GimpCoords *ret_val);
void gimp_coords_average (const GimpCoords *a,
const GimpCoords *b,
GimpCoords *ret_average);
void gimp_coords_add (const GimpCoords *a,
const GimpCoords *b,
GimpCoords *ret_add);
void gimp_coords_difference (const GimpCoords *a,
const GimpCoords *b,
GimpCoords *difference);
void gimp_coords_scale (const gdouble f,
const GimpCoords *a,
GimpCoords *ret_product);
void gimp_coords_mix (const gdouble amul,
const GimpCoords *a,
const gdouble bmul,
const GimpCoords *b,
GimpCoords *ret_val);
void gimp_coords_average (const GimpCoords *a,
const GimpCoords *b,
GimpCoords *ret_average);
void gimp_coords_add (const GimpCoords *a,
const GimpCoords *b,
GimpCoords *ret_add);
void gimp_coords_difference (const GimpCoords *a,
const GimpCoords *b,
GimpCoords *difference);
void gimp_coords_scale (const gdouble f,
const GimpCoords *a,
GimpCoords *ret_product);
gdouble gimp_coords_scalarprod (const GimpCoords *a,
const GimpCoords *b);
gdouble gimp_coords_length (const GimpCoords *a);
gdouble gimp_coords_length2 (const GimpCoords *a);
gdouble gimp_coords_scalarprod (const GimpCoords *a,
const GimpCoords *b);
gdouble gimp_coords_length (const GimpCoords *a);
gdouble gimp_coords_length_squared (const GimpCoords *a);
gboolean gimp_coords_equal (const GimpCoords *a,
const GimpCoords *b);
gboolean gimp_coords_equal (const GimpCoords *a,
const GimpCoords *b);
#endif /* __GIMP_COORDS_H__ */
......@@ -694,8 +694,8 @@ gimp_bezier_stroke_segment_nearest_point_get (const GimpCoords *beziercoords,
gimp_coords_difference (&beziercoords[3], &beziercoords[2], &point2);
if (!depth || (gimp_bezier_coords_is_straight (beziercoords, precision)
&& gimp_coords_length2 (&point1) < precision
&& gimp_coords_length2 (&point2) < precision))
&& gimp_coords_length_squared (&point1) < precision
&& gimp_coords_length_squared (&point2) < precision))
{
GimpCoords line, dcoord;
gdouble length2, scalar;
......@@ -1782,7 +1782,7 @@ gimp_bezier_coords_is_straight (const GimpCoords *beziercoords,
&(beziercoords[0]),
&line);
if (gimp_coords_length2 (&line) < precision * precision)
if (gimp_coords_length_squared (&line) < precision * precision)
{
gimp_coords_difference (&(beziercoords[1]),
&(beziercoords[0]),
......@@ -1790,8 +1790,8 @@ gimp_bezier_coords_is_straight (const GimpCoords *beziercoords,
gimp_coords_difference (&(beziercoords[2]),
&(beziercoords[3]),
&tan2);
if ((gimp_coords_length2 (&tan1) < precision * precision) &&
(gimp_coords_length2 (&tan2) < precision * precision))
if ((gimp_coords_length_squared (&tan1) < precision * precision) &&
(gimp_coords_length_squared (&tan2) < precision * precision))
{
return 1;
}
......@@ -1823,8 +1823,8 @@ gimp_bezier_coords_is_straight (const GimpCoords *beziercoords,
gimp_coords_mix (1.0, &tan1, - s1, &line, &d1);
gimp_coords_mix (1.0, &tan2, - s2, &line, &d2);
if ((gimp_coords_length2 (&d1) > precision * precision) ||
(gimp_coords_length2 (&d2) > precision * precision))
if ((gimp_coords_length_squared (&d1) > precision * precision) ||
(gimp_coords_length_squared (&d2) > precision * precision))
{
/* The control points are too far away from the baseline */
return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment