PCB_FIELDs don't belong in the view.

They're handled by their parent FOOTPRINTs.

Also makes sure footprint children get their parents
updated on a swap.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16412
This commit is contained in:
Jeff Young 2023-12-31 21:36:33 +00:00
parent 55b6fdd1c4
commit 985e590e6f
2 changed files with 15 additions and 5 deletions

View File

@ -2963,7 +2963,21 @@ void FOOTPRINT::swapData( BOARD_ITEM* aImage )
{
wxASSERT( aImage->Type() == PCB_FOOTPRINT_T );
std::swap( *this, *static_cast<FOOTPRINT*>( aImage ) );
FOOTPRINT* image = static_cast<FOOTPRINT*>( aImage );
std::swap( *this, *image );
RunOnChildren(
[&]( BOARD_ITEM* child )
{
child->SetParent( this );
} );
image->RunOnChildren(
[&]( BOARD_ITEM* child )
{
child->SetParent( image );
} );
}

View File

@ -436,11 +436,7 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
newField->Rotate( aPcbFootprint->GetPosition(), aPcbFootprint->GetOrientation() );
if( m_frame )
{
newField->StyleFromSettings( m_frame->GetDesignSettings() );
KIGFX::PCB_VIEW* view = m_frame->GetCanvas()->GetView();
view->Add( newField );
}
}
}