Swap command improperly rotates parts when flipping
Description
When use the Swap tool on two footprints, the two footprints exchange their locations, rotation angles, and board sides.
When you swap two footprints that are on different sides of the board and have different rotations, the rotation angle does not get set properly. The rotation angle gets negated when it shouldn't - the flip part of the swap causes the rotation angle to be negated. Maybe the flip and rotate happen in the wrong order?
Before swap:
After swap:
This reproduces in 7.0.9 and master.
Steps to reproduce
- Open demo project: swap_bug.zip
- select R1
- Shift select R2
- right click -> Swap.
- R1 and R2 swap places, but R1's orientation is negated from what it should be. R2 was originally rotated 20deg, which is what R1 should be after the swap, but instead it's -20deg.
KiCad Version
Application: KiCad arm64 on arm64
Version: 7.0.9-rc1, release build
Libraries:
wxWidgets 3.2.3
FreeType 2.13.0
HarfBuzz 7.3.0
FontConfig 2.14.2
Platform: macOS Monterey Version 12.7 (Build 21G816), 64 bit, Little endian, wxMac
wxWidgets: 3.2.3 (wchar_t,wx containers)
Boost: 1.82.0
OCC: 7.7.0
Curl: 7.77.0
ngspice: 41
Compiler: Clang 13.0.0 with C++ ABI 1002
Build settings:
KICAD_SPICE=ON