Fix SHAPE_LINE_CHAIN::Replace at end of chain
This commit is contained in:
parent
e5586fb974
commit
80355f04a9
|
@ -1057,6 +1057,12 @@ void SHAPE_LINE_CHAIN::Append( const SHAPE_ARC& aArc )
|
||||||
|
|
||||||
void SHAPE_LINE_CHAIN::Insert( size_t aVertex, const VECTOR2I& aP )
|
void SHAPE_LINE_CHAIN::Insert( size_t aVertex, const VECTOR2I& aP )
|
||||||
{
|
{
|
||||||
|
if( aVertex == m_points.size() )
|
||||||
|
{
|
||||||
|
Append( aP );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wxCHECK( aVertex < m_points.size(), /* void */ );
|
wxCHECK( aVertex < m_points.size(), /* void */ );
|
||||||
|
|
||||||
if( aVertex > 0 && IsPtOnArc( aVertex ) )
|
if( aVertex > 0 && IsPtOnArc( aVertex ) )
|
||||||
|
|
|
@ -645,9 +645,8 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector<RefDesInfo>& aBadR
|
||||||
bool annotateBack = m_AnnotateBack->GetValue(); // Unless only doing front
|
bool annotateBack = m_AnnotateBack->GetValue(); // Unless only doing front
|
||||||
bool skipLocked = m_ExcludeLocked->GetValue();
|
bool skipLocked = m_ExcludeLocked->GetValue();
|
||||||
|
|
||||||
int errorcount = 0;
|
int errorcount = 0;
|
||||||
unsigned int backstartrefdes;
|
size_t firstnum = 0;
|
||||||
size_t firstnum = 0;
|
|
||||||
|
|
||||||
m_frontFootprints.clear();
|
m_frontFootprints.clear();
|
||||||
m_backFootprints.clear();
|
m_backFootprints.clear();
|
||||||
|
|
|
@ -317,6 +317,11 @@ BOOST_AUTO_TEST_CASE( ReplaceChain )
|
||||||
baseChain.Replace( 1, 23, replaceChain );
|
baseChain.Replace( 1, 23, replaceChain );
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL( baseChain.PointCount(), linePts.size() - ( 23 - 1 ) );
|
BOOST_CHECK_EQUAL( baseChain.PointCount(), linePts.size() - ( 23 - 1 ) );
|
||||||
|
|
||||||
|
// Replacing the last point in a chain is special-cased
|
||||||
|
baseChain.Replace( baseChain.PointCount() - 1, baseChain.PointCount() - 1, VECTOR2I( -1, -1 ) );
|
||||||
|
|
||||||
|
BOOST_CHECK_EQUAL( baseChain.CLastPoint(), VECTOR2I( -1, -1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue