Handle orientation when pasting footprint items.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17518
(cherry picked from commit 94223ca794
)
This commit is contained in:
parent
1ef916086d
commit
48f14d6dea
|
@ -739,8 +739,8 @@ static void pasteFootprintItemsToFootprintEditor( FOOTPRINT* aClipFootprint, BOA
|
||||||
|
|
||||||
aClipFootprint->Pads().clear();
|
aClipFootprint->Pads().clear();
|
||||||
|
|
||||||
// Not all graphic items can be added to the current footprint:
|
// Not all items can be added to the current footprint: mandatory fields are already existing
|
||||||
// mandatory fields are already existing in the current footprint.
|
// in the current footprint.
|
||||||
//
|
//
|
||||||
for( PCB_FIELD* field : aClipFootprint->Fields() )
|
for( PCB_FIELD* field : aClipFootprint->Fields() )
|
||||||
{
|
{
|
||||||
|
@ -776,6 +776,9 @@ static void pasteFootprintItemsToFootprintEditor( FOOTPRINT* aClipFootprint, BOA
|
||||||
text->SetTextAngle( text->GetTextAngle() + editorFootprint->GetOrientation() );
|
text->SetTextAngle( text->GetTextAngle() + editorFootprint->GetOrientation() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item->Rotate( item->GetPosition(), -aClipFootprint->GetOrientation() );
|
||||||
|
item->Rotate( item->GetPosition(), editorFootprint->GetOrientation() );
|
||||||
|
|
||||||
VECTOR2I pos = item->GetFPRelativePosition();
|
VECTOR2I pos = item->GetFPRelativePosition();
|
||||||
item->SetParent( editorFootprint );
|
item->SetParent( editorFootprint );
|
||||||
item->SetFPRelativePosition( pos );
|
item->SetFPRelativePosition( pos );
|
||||||
|
|
Loading…
Reference in New Issue