BOARD_NETLIST_UPDATER: fix incorrect handling of new fields added to a Fp

- the new field position/rotation is now the same as its footprint parent.
- it is added to the view.
This commit is contained in:
jean-pierre charras 2023-07-22 10:52:49 +02:00
parent 24452f41ad
commit 878a67ca65
1 changed files with 11 additions and 0 deletions

View File

@ -373,6 +373,17 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
newField->SetVisible( false );
newField->SetLayer( aPcbFootprint->GetLayer() == F_Cu ? F_Fab : B_Fab );
newField->StyleFromSettings( m_frame->GetDesignSettings() );
// Give the relative position (0,0) in footprint
newField->SetPosition( aPcbFootprint->GetPosition() );
// Give the footprint orientation
newField->Rotate( aPcbFootprint->GetPosition(), aPcbFootprint->GetOrientation() );
if( m_frame )
{
auto view = m_frame->GetCanvas()->GetView();
view->Add( newField );
}
}
}
}