Copy shape data when converting PCB TEXTBOX to FP.

Fixes https://gitlab.com/kicad/code/kicad/issues/12298
This commit is contained in:
Jeff Young 2022-08-28 21:33:18 +01:00
parent 77c79b6f6a
commit b886ec728e
1 changed files with 6 additions and 0 deletions

View File

@ -787,6 +787,12 @@ int PCB_CONTROL::Paste( const TOOL_EVENT& aEvent )
// Convert to PCB_FP_TEXTBOX_T
FP_TEXTBOX* pastedTextBox = new FP_TEXTBOX( editorFootprint );
// Handle shape data
static_cast<PCB_SHAPE*>( pastedTextBox )->SwapData( clipTextBox );
pastedTextBox->SetLocalCoord();
// Handle text data
static_cast<EDA_TEXT*>( pastedTextBox )->SwapText( *clipTextBox );
static_cast<EDA_TEXT*>( pastedTextBox )->SwapAttributes( *clipTextBox );