Make pad flipping work both from parent footprint *and* individually.

The last fix was for individual pads, but it broke when the whole
footprint was flipped for rotated footprints.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14829
This commit is contained in:
Jeff Young 2023-05-31 11:13:04 +01:00
parent d827bb8a1f
commit 8baf2a832f
1 changed files with 7 additions and 3 deletions

View File

@ -1614,14 +1614,18 @@ void FOOTPRINT::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
// Flip layer
BOARD_ITEM::SetLayer( FlipLayer( GetLayer() ) );
// Reverse mirror orientation.
m_orient = -m_orient;
m_orient.Normalize180();
// Calculate the new orientation, and then clear it for pad flipping.
EDA_ANGLE newOrientation = -m_orient;
newOrientation.Normalize180();
m_orient = ANGLE_0;
// Mirror pads to other side of board.
for( PAD* pad : m_pads )
pad->Flip( m_pos, false );
// Now set the new orientation.
m_orient = newOrientation;
// Mirror zones to other side of board.
for( ZONE* zone : m_zones )
zone->Flip( m_pos, false );