ClipVertexRange: fix fallout of NextShape API change

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9711
This commit is contained in:
Jon Evans 2021-11-21 11:03:22 -05:00
parent 302c5ab537
commit b1878fcc54
1 changed files with 1 additions and 2 deletions

View File

@ -1079,12 +1079,11 @@ void LINE::ClipVertexRange( int aStart, int aEnd )
*/ */
int firstLink = 0; int firstLink = 0;
int lastLink = std::max( 0, static_cast<int>( m_links.size() ) - 1 ); int lastLink = std::max( 0, static_cast<int>( m_links.size() ) - 1 );
int arcIdx = -1;
int linkIdx = 0; int linkIdx = 0;
int numPoints = static_cast<int>( m_line.PointCount() ); int numPoints = static_cast<int>( m_line.PointCount() );
for( int i = 0; i < m_line.PointCount(); i = m_line.NextShape( i ) ) for( int i = 0; i >= 0 && i < m_line.PointCount(); i = m_line.NextShape( i ) )
{ {
if( i <= aStart ) if( i <= aStart )
firstLink = linkIdx; firstLink = linkIdx;