Don't leave orphaned nets in pads after editing in FPEditor.

Fixes https://gitlab.com/kicad/code/kicad/issues/9789
This commit is contained in:
Jeff Young 2021-11-27 12:33:34 +00:00
parent f78033b03c
commit b0d7c1a810
1 changed files with 7 additions and 1 deletions

View File

@ -517,13 +517,19 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew,
{
PAD* pad_model = nullptr;
// Skip pad not on a copper layer, because we only want to transfer the net info
// Pads with no copper are never connected to a net
if( !pad->IsOnCopperLayer() )
{
pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
continue;
}
// Pads with no numbers are never connected to a net
if( pad->GetNumber().IsEmpty() )
{
pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
continue;
}
// Search for a similar pad on a copper layer, to reuse net info
PAD* last_pad = nullptr;