From 7b21586f0ef937ba44a68d4e4148d0e698a45be0 Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Sun, 2 Oct 2005 01:08:46 +0000 Subject: [PATCH] fixed the bogus snaps. One should not calculate tangents for points beyond 2005-10-02 Simon Budig * app/vectors/gimpbezierstroke.c: fixed the bogus snaps. One should not calculate tangents for points beyond the end of the array... --- ChangeLog | 6 ++++++ app/vectors/gimpbezierstroke.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66b59328e8..234af77638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-02 Simon Budig + + * 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 * app/vectors/gimpbezierstroke.c: a segment doesn't necessarily diff --git a/app/vectors/gimpbezierstroke.c b/app/vectors/gimpbezierstroke.c index 2076a1a943..e0a3d46d7a 100644 --- a/app/vectors/gimpbezierstroke.c +++ b/app/vectors/gimpbezierstroke.c @@ -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;