Fix a bug in RebuildBezierToSegmentsPointsList.

(cherry picked from commit 9f63820ed4)
This commit is contained in:
Alex Shvartzkop 2023-09-11 09:35:07 +03:00
parent c7a4ea97c3
commit c11ae8bd02
1 changed files with 3 additions and 3 deletions

View File

@ -417,11 +417,11 @@ void EDA_SHAPE::RebuildBezierToSegmentsPointsList( int aMinSegLen )
// Ensure last point respects aMinSegLen parameter // Ensure last point respects aMinSegLen parameter
if( m_bezierPoints.size() > 2 ) 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(); m_bezierPoints.pop_back();
} }
} }