Make sure pasted items get their netclass updated along with their net.

Fixes https://gitlab.com/kicad/code/kicad/issues/4974
This commit is contained in:
Jeff Young 2020-07-31 16:46:45 +01:00
parent 1be39195ab
commit ba537209ab
2 changed files with 1 additions and 2 deletions

View File

@ -89,7 +89,6 @@ public:
*/
void SetNet( NETINFO_ITEM* aNetInfo )
{
wxASSERT( aNetInfo->GetBoard() == GetBoard() || aNetInfo == NETINFO_LIST::OrphanedItem() );
m_netinfo = aNetInfo;
}

View File

@ -1866,7 +1866,7 @@ void BOARD::MapNets( const BOARD* aDestBoard )
NETINFO_ITEM* netInfo = aDestBoard->FindNet( item->GetNetname() );
if( netInfo )
item->SetNetCode( netInfo->GetNet() );
item->SetNet( netInfo );
else
item->SetNetCode( 0 );
}