Rename Mirror template to MIRRORVAL to avoid shadowing

I am bad at naming creativity here, but hey, it's unique
This commit is contained in:
Marek Roszko 2020-10-25 20:44:22 -04:00
parent 49607be57b
commit 9de0ff22c1
3 changed files with 8 additions and 8 deletions

View File

@ -186,7 +186,7 @@ void SCH_TEXT::MirrorY( int aYaxis_position )
// Text is NOT really mirrored; it is moved to a suitable horizontal position
SetLabelSpinStyle( GetLabelSpinStyle().MirrorY() );
SetTextX( Mirror( GetTextPos().x, aYaxis_position ) );
SetTextX( MIRRORVAL( GetTextPos().x, aYaxis_position ) );
}
@ -195,7 +195,7 @@ void SCH_TEXT::MirrorX( int aXaxis_position )
// Text is NOT really mirrored; it is moved to a suitable vertical position
SetLabelSpinStyle( GetLabelSpinStyle().MirrorX() );
SetTextY( Mirror( GetTextPos().y, aXaxis_position ) );
SetTextY( MIRRORVAL( GetTextPos().y, aXaxis_position ) );
}

View File

@ -128,14 +128,14 @@ constexpr std::size_t arrayDim(T const (&)[N]) noexcept
* Mirror @a aPoint in @a aMirrorRef.
*/
template<typename T>
T Mirror( T aPoint, T aMirrorRef )
T MIRRORVAL( T aPoint, T aMirrorRef )
{
return -( aPoint - aMirrorRef ) + aMirrorRef;
}
template<typename T>
void MIRROR( T& aPoint, const T& aMirrorRef )
{
aPoint = Mirror( aPoint, aMirrorRef );
aPoint = MIRRORVAL( aPoint, aMirrorRef );
}
#endif // MACROS_H

View File

@ -142,9 +142,9 @@ void FP_TEXT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{
// flipping the footprint is relative to the X axis
if( aFlipLeftRight )
SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
SetTextX( ::MIRRORVAL( GetTextPos().x, aCentre.x ) );
else
SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
SetTextY( ::MIRRORVAL( GetTextPos().y, aCentre.y ) );
SetTextAngle( -GetTextAngle() );
@ -174,9 +174,9 @@ void FP_TEXT::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
// the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
// the position is mirrored, but the text itself is not mirrored
if( aMirrorAroundXAxis )
SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
SetTextY( ::MIRRORVAL( GetTextPos().y, aCentre.y ) );
else
SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
SetTextX( ::MIRRORVAL( GetTextPos().x, aCentre.x ) );
SetLocalCoord();
}