From 9faa7cb0ca1f5646c986ff97ec961fc71294774f Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 24 May 2019 03:39:34 +0000 Subject: [PATCH] Fix commit cc107887. --- src/mesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 7767901..52f8c0b 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -186,7 +186,7 @@ void SMesh::Simplify(int start) { if(fabs(bDot) < LENGTH_EPS && fabs(dDot) < LENGTH_EPS) { conv[WRAP((j+1), convc)] = c; // and remove the vertex at j, which is a dup - std::move(conv+j+1, conv+convc, conv+(convc-1)); + std::move(conv+j+1, conv+convc, conv+j); convc--; } else if(fabs(bDot) < LENGTH_EPS && dDot > 0) { conv[j] = c; @@ -194,7 +194,7 @@ void SMesh::Simplify(int start) { conv[WRAP((j+1), convc)] = c; } else if(bDot > 0 && dDot > 0) { // conv[j] is unchanged, conv[j+1] goes to [j+2] - std::move_backward(conv+j+1, conv+convc, conv+j+2); + std::move_backward(conv+j+1, conv+convc, conv+convc+1); conv[j+1] = c; convc++; } else {