From 2e6644fd443bbdc11070840543c161a86dc389e1 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 20 Jun 2019 18:57:42 -0300 Subject: [PATCH] Backout changeset b0094b5a9fa7f9a8f38040ec2f3d94d0a3cf31ce --- src/modules/math/BezierCurve.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/math/BezierCurve.cpp b/src/modules/math/BezierCurve.cpp index e27a6ea23..83957a8c1 100644 --- a/src/modules/math/BezierCurve.cpp +++ b/src/modules/math/BezierCurve.cpp @@ -69,14 +69,11 @@ void subdivide(vector &points, int k) subdivide(right, k-1); // merge (right is in reversed order) - // By this point the 'left' array has a point at the end that's collinear - // with other points. It's still needed for the subdivide calls above but we - // can get rid of it here. - points.resize(left.size() + right.size() - 2); - for (size_t i = 0; i < left.size() - 1; ++i) + points.resize(left.size() + right.size() - 1); + for (size_t i = 0; i < left.size(); ++i) points[i] = left[i]; for (size_t i = 1; i < right.size(); ++i) - points[i-1 + left.size() - 1] = right[right.size() - i - 1]; + points[i-1 + left.size()] = right[right.size() - i - 1]; } }