get_closest_point: Prefer earlier points
Only switch to a later point if it is strictly closer than the existing match. This fixes start- vs endpoint confusion in the rectangle tests.
This commit is contained in:
@@ -451,7 +451,8 @@ gsk_standard_contour_get_closest_point (const GskContour *contour,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
gsk_curve_init (&c, self->ops[i]);
|
gsk_curve_init (&c, self->ops[i]);
|
||||||
if (gsk_curve_get_closest_point (&c, point, threshold, &distance, &t))
|
if (gsk_curve_get_closest_point (&c, point, threshold, &distance, &t) &&
|
||||||
|
distance < threshold)
|
||||||
{
|
{
|
||||||
best_idx = i;
|
best_idx = i;
|
||||||
best_t = t;
|
best_t = t;
|
||||||
|
|||||||
Reference in New Issue
Block a user