diff --git a/lib/Slic3r/Geometry.pm b/lib/Slic3r/Geometry.pm index d21cff330..e1a591025 100644 --- a/lib/Slic3r/Geometry.pm +++ b/lib/Slic3r/Geometry.pm @@ -252,7 +252,7 @@ sub nearest_point_index { if (!defined $distance || $d < $distance) { $nearest_point_index = $i; $distance = $d; - return $i if $distance < epsilon; + last if $distance < epsilon; } } return $nearest_point_index;