fixed the bogus snaps. One should not calculate tangents for points beyond

2005-10-02  Simon Budig  <simon@gimp.org>

	* app/vectors/gimpbezierstroke.c: fixed the bogus snaps. One
	should not calculate tangents for points beyond the end of the
	array...
This commit is contained in:
Simon Budig 2005-10-02 01:08:46 +00:00 committed by Simon Budig
parent 3b0594c429
commit 7b21586f0e
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2005-10-02 Simon Budig <simon@gimp.org>
* app/vectors/gimpbezierstroke.c: fixed the bogus snaps. One
should not calculate tangents for points beyond the end of the
array...
2005-10-02 Simon Budig <simon@gimp.org>
* app/vectors/gimpbezierstroke.c: a segment doesn't necessarily

View File

@ -971,10 +971,10 @@ gimp_bezier_stroke_segment_nearest_tangent_get (const GimpCoords *beziercoords,
&dir);
ori = dir.x * line.y - dir.y * line.x;
for (i = 1; i < ret_coords->len; i++)
for (i = 2; i < ret_coords->len; i++)
{
gimp_coords_difference (&g_array_index (ret_coords, GimpCoords, i+1),
&g_array_index (ret_coords, GimpCoords, i),
gimp_coords_difference (&g_array_index (ret_coords, GimpCoords, i),
&g_array_index (ret_coords, GimpCoords, i-1),
&dir);
ori2 = dir.x * line.y - dir.y * line.x;