Only clean up tracks completely inside pads.

Fixes https://gitlab.com/kicad/code/kicad/issues/5093
This commit is contained in:
Jeff Young 2020-08-06 21:52:24 +01:00
parent 76bd344730
commit ea1be41ff0
1 changed files with 12 additions and 4 deletions

View File

@ -330,11 +330,19 @@ void TRACKS_CLEANER::deleteTracksInPads()
{
if( pad->HitTest( track->GetStart() ) && pad->HitTest( track->GetEnd() ) )
{
CLEANUP_ITEM* item = new CLEANUP_ITEM( CLEANUP_TRACK_IN_PAD );
item->SetItems( track );
m_itemsList->push_back( item );
SHAPE_POLY_SET poly;
track->TransformShapeWithClearanceToPolygon( poly, 0 );
toRemove.insert( track );
poly.BooleanSubtract( *pad->GetEffectivePolygon(), SHAPE_POLY_SET::PM_FAST );
if( poly.IsEmpty() )
{
CLEANUP_ITEM* item = new CLEANUP_ITEM( CLEANUP_TRACK_IN_PAD );
item->SetItems( track );
m_itemsList->push_back( item );
toRemove.insert( track );
}
}
}
}