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:
parent
55b6fdd1c4
commit
985e590e6f
|
@ -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 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue