From 3b0594c42999aa474b8099a3c58238fe21120789 Mon Sep 17 00:00:00 2001 From: Simon Budig Date: Sun, 2 Oct 2005 00:25:06 +0000 Subject: [PATCH] a segment doesn't necessarily have a matching tangent. Check for this when 2005-10-02 Simon Budig * app/vectors/gimpbezierstroke.c: a segment doesn't necessarily have a matching tangent. Check for this when iterating over all segments of a path... * app/vectors/gimpstroke.c: fix the dispatch of _nearest_intersection_get(). --- ChangeLog | 9 +++++++++ app/vectors/gimpbezierstroke.c | 4 ++-- app/vectors/gimpstroke.c | 18 +++++++++--------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c65127865b..66b59328e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-10-02 Simon Budig + + * app/vectors/gimpbezierstroke.c: a segment doesn't necessarily + have a matching tangent. Check for this when iterating over all + segments of a path... + + * app/vectors/gimpstroke.c: fix the dispatch of + _nearest_intersection_get(). + 2005-10-02 Simon Budig * app/vectors/gimpbezierstroke.c: correctly pass back the diff --git a/app/vectors/gimpbezierstroke.c b/app/vectors/gimpbezierstroke.c index 7888d883f1..2076a1a943 100644 --- a/app/vectors/gimpbezierstroke.c +++ b/app/vectors/gimpbezierstroke.c @@ -881,7 +881,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke, precision, &point, &pos); - if (dist < min_dist || min_dist < 0) + if (dist >= 0 && (dist < min_dist || min_dist < 0)) { min_dist = dist; if (ret_pos) @@ -920,7 +920,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke, precision, &point, &pos); - if (dist < min_dist || min_dist < 0) + if (dist >= 0 && (dist < min_dist || min_dist < 0)) { min_dist = dist; if (ret_pos) diff --git a/app/vectors/gimpstroke.c b/app/vectors/gimpstroke.c index a4f14f38ed..f4e4b68ed8 100644 --- a/app/vectors/gimpstroke.c +++ b/app/vectors/gimpstroke.c @@ -469,15 +469,15 @@ gimp_stroke_nearest_intersection_get (const GimpStroke *stroke, g_return_val_if_fail (coords1 != NULL, FALSE); g_return_val_if_fail (direction != NULL, FALSE); - if (GIMP_STROKE_GET_CLASS (stroke)->nearest_tangent_get) - return GIMP_STROKE_GET_CLASS (stroke)->nearest_tangent_get (stroke, - coords1, - direction, - precision, - nearest, - ret_segment_start, - ret_segment_end, - ret_pos); + if (GIMP_STROKE_GET_CLASS (stroke)->nearest_intersection_get) + return GIMP_STROKE_GET_CLASS (stroke)->nearest_intersection_get (stroke, + coords1, + direction, + precision, + nearest, + ret_segment_start, + ret_segment_end, + ret_pos); return -1; } -- GitLab