Commit 3b0594c4 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

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().
parent e57ad0f8
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> 2005-10-02 Simon Budig <simon@gimp.org>
* app/vectors/gimpbezierstroke.c: correctly pass back the * app/vectors/gimpbezierstroke.c: correctly pass back the
......
...@@ -881,7 +881,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke, ...@@ -881,7 +881,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke,
precision, precision,
&point, &pos); &point, &pos);
if (dist < min_dist || min_dist < 0) if (dist >= 0 && (dist < min_dist || min_dist < 0))
{ {
min_dist = dist; min_dist = dist;
if (ret_pos) if (ret_pos)
...@@ -920,7 +920,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke, ...@@ -920,7 +920,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke,
precision, precision,
&point, &pos); &point, &pos);
if (dist < min_dist || min_dist < 0) if (dist >= 0 && (dist < min_dist || min_dist < 0))
{ {
min_dist = dist; min_dist = dist;
if (ret_pos) if (ret_pos)
......
...@@ -469,15 +469,15 @@ gimp_stroke_nearest_intersection_get (const GimpStroke *stroke, ...@@ -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 (coords1 != NULL, FALSE);
g_return_val_if_fail (direction != NULL, FALSE); g_return_val_if_fail (direction != NULL, FALSE);
if (GIMP_STROKE_GET_CLASS (stroke)->nearest_tangent_get) if (GIMP_STROKE_GET_CLASS (stroke)->nearest_intersection_get)
return GIMP_STROKE_GET_CLASS (stroke)->nearest_tangent_get (stroke, return GIMP_STROKE_GET_CLASS (stroke)->nearest_intersection_get (stroke,
coords1, coords1,
direction, direction,
precision, precision,
nearest, nearest,
ret_segment_start, ret_segment_start,
ret_segment_end, ret_segment_end,
ret_pos); ret_pos);
return -1; return -1;
} }
......
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