From a786607ec5eeffaa3a725ec2d1af1cf83a39444f Mon Sep 17 00:00:00 2001 From: kreso-t Date: Tue, 4 Sep 2018 00:32:12 +0200 Subject: [PATCH] Path: Adaptive - bugfix --- src/Mod/Path/libarea/Adaptive.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index d8abe08edb..3270298888 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -645,18 +645,19 @@ namespace AdaptivePath { } void ShiftPathToStartWithClosestPoint(const Path & path,IntPoint p1, Path & result) { - Paths paths; - paths.push_back(path); - IntPoint clp; - size_t clpPathIndex; - size_t clpSegmentIndex1; - double clpParameter1; - // find closest point - double distSqrd=DistancePointToPathsSqrd(paths,p1,clp,clpPathIndex,clpSegmentIndex1,clpParameter1); + double minDistSqrd=__DBL_MAX__; + long closestPointIndex=0; + for(size_t i=0;i=path.size()) index-=path.size(); result.push_back(path[index]); }