PNS: Discard duplicate tracks in FixRoute
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8737
This commit is contained in:
parent
ff2e470a6e
commit
e61b1f03b8
|
@ -1365,7 +1365,9 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
|||
std::unique_ptr<ARC> ap = std::make_unique<ARC>( arc );
|
||||
lastItem = ap.get();
|
||||
|
||||
m_lastNode->Add( std::move( ap ) );
|
||||
if( !m_lastNode->Add( std::move( ap ) ) )
|
||||
lastItem = nullptr;
|
||||
|
||||
lastArc = arcIndex;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -662,10 +662,19 @@ void NODE::addArc( ARC* aArc )
|
|||
}
|
||||
|
||||
|
||||
void NODE::Add( std::unique_ptr< ARC > aArc )
|
||||
bool NODE::Add( std::unique_ptr< ARC > aArc, bool aAllowRedundant )
|
||||
{
|
||||
const SHAPE_ARC& arc = aArc->CArc();
|
||||
|
||||
if( !aAllowRedundant && findRedundantArc( arc.GetP0(), arc.GetP1(), aArc->Layers(),
|
||||
aArc->Net() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
aArc->SetOwner( this );
|
||||
addArc( aArc.release() );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ public:
|
|||
bool Add( std::unique_ptr< SEGMENT > aSegment, bool aAllowRedundant = false );
|
||||
void Add( std::unique_ptr< SOLID > aSolid );
|
||||
void Add( std::unique_ptr< VIA > aVia );
|
||||
void Add( std::unique_ptr< ARC > aArc );
|
||||
bool Add( std::unique_ptr< ARC > aArc, bool aAllowRedundant = false );
|
||||
|
||||
void Add( LINE& aLine, bool aAllowRedundant = false );
|
||||
|
||||
|
|
Loading…
Reference in New Issue