Pcbnew: fix Swap command that improperly rotates footprints when flipping.
Fixes #16025 https://gitlab.com/kicad/code/kicad/-/issues/16025
This commit is contained in:
parent
2deee01592
commit
3195ba646f
|
@ -154,6 +154,10 @@ int EDIT_TOOL::Swap( const TOOL_EVENT& aEvent )
|
|||
FOOTPRINT* aFP = static_cast<FOOTPRINT*>( a );
|
||||
FOOTPRINT* bFP = static_cast<FOOTPRINT*>( b );
|
||||
|
||||
// Store initial orientation of footprints, before flipping them.
|
||||
EDA_ANGLE aAngle = aFP->GetOrientation();
|
||||
EDA_ANGLE bAngle = bFP->GetOrientation();
|
||||
|
||||
// Flip both if needed
|
||||
if( aFP->IsFlipped() != bFP->IsFlipped() )
|
||||
{
|
||||
|
@ -162,7 +166,6 @@ int EDIT_TOOL::Swap( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
// Set orientation
|
||||
EDA_ANGLE aAngle = aFP->GetOrientation(), bAngle = bFP->GetOrientation();
|
||||
std::swap( aAngle, bAngle );
|
||||
aFP->SetOrientation( aAngle );
|
||||
bFP->SetOrientation( bAngle );
|
||||
|
|
Loading…
Reference in New Issue