From c11ae8bd021b0d51e80e4022ebe67c0cbef0060f Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Mon, 11 Sep 2023 09:35:07 +0300 Subject: [PATCH] Fix a bug in RebuildBezierToSegmentsPointsList. (cherry picked from commit 9f63820ed40302286f5e0b2d7b4c597913e48cb0) --- common/eda_shape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 3fb784642d..00af80752e 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -417,11 +417,11 @@ void EDA_SHAPE::RebuildBezierToSegmentsPointsList( int aMinSegLen ) // Ensure last point respects aMinSegLen parameter if( m_bezierPoints.size() > 2 ) { - int idx = m_bezierPoints.size()-1; + int idx = m_bezierPoints.size() - 1; - if( VECTOR2I( m_bezierPoints[idx] - m_bezierPoints[idx]-1 ).EuclideanNorm() < aMinSegLen ) + if( VECTOR2I( m_bezierPoints[idx] - m_bezierPoints[idx] - 1 ).EuclideanNorm() < aMinSegLen ) { - m_bezierPoints[idx]-1 = m_bezierPoints[idx]; + m_bezierPoints[idx - 1] = m_bezierPoints[idx]; m_bezierPoints.pop_back(); } }