Unify flip direction handling

There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
This commit is contained in:
John Beard
2024-09-27 17:13:13 +01:00
parent 3066ad2088
commit 215533f31a
75 changed files with 293 additions and 448 deletions
+3 -11
View File
@@ -180,18 +180,10 @@ const VECTOR2I PCB_REFERENCE_IMAGE::GetSize() const
}
void PCB_REFERENCE_IMAGE::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
void PCB_REFERENCE_IMAGE::Flip( const VECTOR2I& aCentre, FLIP_DIRECTION aFlipDirection )
{
if( aFlipLeftRight )
{
MIRROR( m_pos.x, aCentre.x );
m_bitmapBase->Mirror( false );
}
else
{
MIRROR( m_pos.y, aCentre.y );
m_bitmapBase->Mirror( true );
}
MIRROR( m_pos, aCentre, aFlipDirection );
m_bitmapBase->Mirror( aFlipDirection );
}
void PCB_REFERENCE_IMAGE::Rotate( const VECTOR2I& aCenter, const EDA_ANGLE& aAngle )