SHAPE_LINE_CHAIN::Split: Add integers before incrementing the iterator

Partially Fixes https://gitlab.com/kicad/code/kicad/-/issues/8131
This commit is contained in:
Roberto Fernandez Bautista 2021-04-06 16:45:46 +01:00 committed by Wayne Stambaugh
parent 2b86b34124
commit b7bd7246af
1 changed files with 2 additions and 2 deletions

View File

@ -397,8 +397,8 @@ int SHAPE_LINE_CHAIN::Split( const VECTOR2I& aP )
if( ii < PointCount() - 1 && m_shapes[ii] >= 0 && m_shapes[ii] == m_shapes[ii + 1] ) if( ii < PointCount() - 1 && m_shapes[ii] >= 0 && m_shapes[ii] == m_shapes[ii + 1] )
ii--; ii--;
m_points.insert( m_points.begin() + ii + 1, aP ); m_points.insert( m_points.begin() + ( ii + 1 ), aP );
m_shapes.insert( m_shapes.begin() + ii + 1, ssize_t( SHAPE_IS_PT ) ); m_shapes.insert( m_shapes.begin() + ( ii + 1 ), ssize_t( SHAPE_IS_PT ) );
return ii + 1; return ii + 1;
} }