Commit 7323c5a0 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

Changed the "gradient" parameter to "slope" to make it more clear what the

2004-12-14  Simon Budig  <simon@gimp.org>

	* app/vectors/gimpstroke.[ch]: Changed the "gradient" parameter
	to "slope" to make it more clear what the returned result is (which
	was wrong earlier).
	* tools/pdbgen/pdb/paths.pdb: changed accordingly

	* app/pdb/paths_cmds.c
	* libgimp/gimppaths_pdb.[ch]
	* devel-docs/libgimp/tmpl/gimppaths.sgml: regenerated.

	Fixes bug #161274.
parent 9dda8327
2004-12-14 Simon Budig <simon@gimp.org>
* app/vectors/gimpstroke.[ch]: Changed the "gradient" parameter
to "slope" to make it more clear what the returned result is (which
was wrong earlier).
* tools/pdbgen/pdb/paths.pdb: changed accordingly
* app/pdb/paths_cmds.c
* libgimp/gimppaths_pdb.[ch]
* devel-docs/libgimp/tmpl/gimppaths.sgml: regenerated.
Fixes bug #161274.
2004-12-14 Maurits Rijk <m.rijk@chello.nl>
* plug-ins/imagemap/imap_selection.c: don't use
......
......@@ -666,7 +666,7 @@ path_get_point_at_dist_invoker (Gimp *gimp,
gdouble distance;
gint32 x_point = 0;
gint32 y_point = 0;
gdouble gradient = 0;
gdouble slope = 0;
GimpVectors *vectors;
GimpStroke *stroke;
gdouble distance_along;
......@@ -703,7 +703,7 @@ path_get_point_at_dist_invoker (Gimp *gimp,
stroke_distance = stroke_distance < 0 ? 0: stroke_distance;
if (!gimp_stroke_get_point_at_dist (stroke, stroke_distance, 0.5,
&position, &gradient))
&position, &slope))
{
success = FALSE;
break;
......@@ -732,7 +732,7 @@ path_get_point_at_dist_invoker (Gimp *gimp,
{
return_args[1].value.pdb_int = x_point;
return_args[2].value.pdb_int = y_point;
return_args[3].value.pdb_float = gradient;
return_args[3].value.pdb_float = slope;
}
return return_args;
......@@ -766,8 +766,8 @@ static ProcArg path_get_point_at_dist_outargs[] =
},
{
GIMP_PDB_FLOAT,
"gradient",
"The gradient at the specified point."
"slope",
"The slope (dy / dx) at the specified point."
}
};
......
......@@ -155,7 +155,7 @@ static gboolean gimp_stroke_real_get_point_at_dist (const GimpStroke *stroke,
const gdouble dist,
const gdouble precision,
GimpCoords *position,
gdouble *gradient);
gdouble *slope);
/* private variables */
......@@ -872,13 +872,13 @@ gimp_stroke_real_get_length (const GimpStroke *stroke,
GArray *points;
gint i;
gdouble length;
GimpCoords difference;
GimpCoords difference;
g_return_val_if_fail (GIMP_IS_STROKE (stroke), -1);
if (!stroke->anchors)
return -1;
points = gimp_stroke_interpolate (stroke, precision, NULL);
if (points == NULL)
return -1;
......@@ -887,7 +887,7 @@ gimp_stroke_real_get_length (const GimpStroke *stroke,
for (i = 0; i < points->len - 1; i++ )
{
gimp_coords_difference (&(g_array_index (points, GimpCoords, i)),
gimp_coords_difference (&(g_array_index (points, GimpCoords, i)),
&(g_array_index (points, GimpCoords, i+1)),
&difference);
length += gimp_coords_length (&difference);
......@@ -1230,7 +1230,7 @@ gimp_stroke_get_point_at_dist (const GimpStroke *stroke,
const gdouble dist,
const gdouble precision,
GimpCoords *position,
gdouble *gradient)
gdouble *slope)
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), FALSE);
......@@ -1238,7 +1238,7 @@ gimp_stroke_get_point_at_dist (const GimpStroke *stroke,
dist,
precision,
position,
gradient);
slope);
}
......@@ -1247,7 +1247,7 @@ gimp_stroke_real_get_point_at_dist (const GimpStroke *stroke,
const gdouble dist,
const gdouble precision,
GimpCoords *position,
gdouble *gradient)
gdouble *slope)
{
GArray *points;
gint i;
......@@ -1285,16 +1285,16 @@ gimp_stroke_real_get_point_at_dist (const GimpStroke *stroke,
u, &(g_array_index (points, GimpCoords , i+1)),
position);
if (difference.y == 0)
*gradient = G_MAXDOUBLE;
else
*gradient = difference.x / difference.y;
if (difference.x == 0)
*slope = G_MAXDOUBLE;
else
*slope = difference.y / difference.x;
ret = TRUE;
break;
}
}
g_array_free (points, TRUE);
return ret;
......
......@@ -123,7 +123,7 @@ struct _GimpStrokeClass
const gdouble dist,
const gdouble precision,
GimpCoords *position,
gdouble *gradient);
gdouble *slope);
GArray * (* interpolate) (const GimpStroke *stroke,
const gdouble precision,
......@@ -252,8 +252,8 @@ gboolean gimp_stroke_get_point_at_dist (const GimpStroke *stroke,
const gdouble dist,
const gdouble precision,
GimpCoords *position,
gdouble *gradient);
gdouble *slope);
/* returns an array of valid coordinates */
GArray * gimp_stroke_interpolate (const GimpStroke *stroke,
const gdouble precision,
......
......@@ -86,7 +86,7 @@ Operations related to paths.
@image_ID:
@distance:
@y_point:
@gradient:
@slope:
@Returns:
......
......@@ -284,7 +284,7 @@ gimp_path_stroke_current (gint32 image_ID)
* @image_ID: The ID of the image the paths belongs to.
* @distance: The distance along the path.
* @y_point: The y position of the point.
* @gradient: The gradient at the specified point.
* @slope: The slope (dy / dx) at the specified point.
*
* Get point on a path at a specified distance along the path.
*
......@@ -301,7 +301,7 @@ gint
gimp_path_get_point_at_dist (gint32 image_ID,
gdouble distance,
gint *y_point,
gdouble *gradient)
gdouble *slope)
{
GimpParam *return_vals;
gint nreturn_vals;
......@@ -317,7 +317,7 @@ gimp_path_get_point_at_dist (gint32 image_ID,
{
x_point = return_vals[1].data.d_int32;
*y_point = return_vals[2].data.d_int32;
*gradient = return_vals[3].data.d_float;
*slope = return_vals[3].data.d_float;
}
gimp_destroy_params (return_vals, nreturn_vals);
......
......@@ -50,7 +50,7 @@ gboolean gimp_path_stroke_current (gint32 image_ID);
gint gimp_path_get_point_at_dist (gint32 image_ID,
gdouble distance,
gint *y_point,
gdouble *gradient);
gdouble *slope);
gint gimp_path_get_tattoo (gint32 image_ID,
const gchar *name);
gboolean gimp_path_set_tattoo (gint32 image_ID,
......
......@@ -351,8 +351,8 @@ HELP
desc => 'The x position of the point.', init => 1 },
{ name => 'y_point', type => 'int32',
desc => 'The y position of the point.', init => 1 },
{ name => 'gradient', type => 'float',
desc => 'The gradient at the specified point.', init => 1 }
{ name => 'slope', type => 'float',
desc => 'The slope (dy / dx) at the specified point.', init => 1 }
);
%invoke = (
......@@ -382,7 +382,7 @@ HELP
stroke_distance = stroke_distance < 0 ? 0: stroke_distance;
if (!gimp_stroke_get_point_at_dist (stroke, stroke_distance, 0.5,
&position, &gradient))
&position, &slope))
{
success = FALSE;
break;
......
Markdown is supported
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