pcbnew: Only remove one duplicate track -- not both
Fixes: lp:1724728 * https://bugs.launchpad.net/kicad/+bug/1724728
This commit is contained in:
parent
107c895cfd
commit
fdae9f0b75
|
@ -444,6 +444,8 @@ bool TRACKS_CLEANER::deleteNullSegments()
|
|||
|
||||
void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOARD_ITEM*>& aToRemove )
|
||||
{
|
||||
if( aTrack->GetFlags() & STRUCT_DELETED )
|
||||
return;
|
||||
|
||||
for( auto other : m_brd->Tracks() )
|
||||
{
|
||||
|
@ -454,6 +456,9 @@ void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOAR
|
|||
if( aTrack == other )
|
||||
continue;
|
||||
|
||||
if( other->GetFlags() & STRUCT_DELETED )
|
||||
continue;
|
||||
|
||||
// Must be of the same type, on the same layer and the endpoints
|
||||
// must be the same (maybe swapped)
|
||||
if( ( aTrack->Type() == other->Type() ) &&
|
||||
|
@ -464,6 +469,7 @@ void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOAR
|
|||
( ( aTrack->GetStart() == other->GetEnd() ) &&
|
||||
( aTrack->GetEnd() == other->GetStart() ) ) )
|
||||
{
|
||||
other->SetFlags( STRUCT_DELETED );
|
||||
aToRemove.insert( other );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue