Handle orientation when pasting footprint items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17518
This commit is contained in:
Jeff Young 2024-05-03 21:30:46 +01:00
parent ba4974749c
commit 94223ca794
1 changed files with 5 additions and 2 deletions

View File

@ -740,8 +740,8 @@ static void pasteFootprintItemsToFootprintEditor( FOOTPRINT* aClipFootprint, BOA
aClipFootprint->Pads().clear();
// Not all graphic items can be added to the current footprint:
// mandatory fields are already existing in the current footprint.
// Not all items can be added to the current footprint: mandatory fields are already existing
// in the current footprint.
//
for( PCB_FIELD* field : aClipFootprint->Fields() )
{
@ -777,6 +777,9 @@ static void pasteFootprintItemsToFootprintEditor( FOOTPRINT* aClipFootprint, BOA
text->SetTextAngle( text->GetTextAngle() + editorFootprint->GetOrientation() );
}
item->Rotate( item->GetPosition(), -aClipFootprint->GetOrientation() );
item->Rotate( item->GetPosition(), editorFootprint->GetOrientation() );
VECTOR2I pos = item->GetFPRelativePosition();
item->SetParent( editorFootprint );
item->SetFPRelativePosition( pos );