a segment doesn't necessarily have a matching tangent. Check for this when

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

	* 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().
This commit is contained in:
Simon Budig 2005-10-02 00:25:06 +00:00 committed by Simon Budig
parent e57ad0f8d0
commit 3b0594c429
3 changed files with 20 additions and 11 deletions

View file

@ -1,3 +1,12 @@
2005-10-02 Simon Budig <simon@gimp.org>
* 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 <simon@gimp.org>
* app/vectors/gimpbezierstroke.c: correctly pass back the

View file

@ -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)

View file

@ -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;
}