pcbnew: Only remove one duplicate track -- not both

Fixes: lp:1724728
* https://bugs.launchpad.net/kicad/+bug/1724728
This commit is contained in:
Seth Hillbrand 2017-10-19 14:09:58 -07:00 committed by jean-pierre charras
parent 107c895cfd
commit fdae9f0b75
1 changed files with 6 additions and 0 deletions

View File

@ -444,6 +444,8 @@ bool TRACKS_CLEANER::deleteNullSegments()
void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOARD_ITEM*>& aToRemove ) void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOARD_ITEM*>& aToRemove )
{ {
if( aTrack->GetFlags() & STRUCT_DELETED )
return;
for( auto other : m_brd->Tracks() ) for( auto other : m_brd->Tracks() )
{ {
@ -454,6 +456,9 @@ void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOAR
if( aTrack == other ) if( aTrack == other )
continue; continue;
if( other->GetFlags() & STRUCT_DELETED )
continue;
// Must be of the same type, on the same layer and the endpoints // Must be of the same type, on the same layer and the endpoints
// must be the same (maybe swapped) // must be the same (maybe swapped)
if( ( aTrack->Type() == other->Type() ) && if( ( aTrack->Type() == other->Type() ) &&
@ -464,6 +469,7 @@ void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set<BOAR
( ( aTrack->GetStart() == other->GetEnd() ) && ( ( aTrack->GetStart() == other->GetEnd() ) &&
( aTrack->GetEnd() == other->GetStart() ) ) ) ( aTrack->GetEnd() == other->GetStart() ) ) )
{ {
other->SetFlags( STRUCT_DELETED );
aToRemove.insert( other ); aToRemove.insert( other );
} }
} }