diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index cf0f524576..d3115dbb84 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -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 ) ); } diff --git a/include/macros.h b/include/macros.h index 09f202474a..86b8425a78 100644 --- a/include/macros.h +++ b/include/macros.h @@ -128,14 +128,14 @@ constexpr std::size_t arrayDim(T const (&)[N]) noexcept * Mirror @a aPoint in @a aMirrorRef. */ template -T Mirror( T aPoint, T aMirrorRef ) +T MIRRORVAL( T aPoint, T aMirrorRef ) { return -( aPoint - aMirrorRef ) + aMirrorRef; } template void MIRROR( T& aPoint, const T& aMirrorRef ) { - aPoint = Mirror( aPoint, aMirrorRef ); + aPoint = MIRRORVAL( aPoint, aMirrorRef ); } #endif // MACROS_H diff --git a/pcbnew/fp_text.cpp b/pcbnew/fp_text.cpp index 02c70bcadf..c2a0ba90e7 100644 --- a/pcbnew/fp_text.cpp +++ b/pcbnew/fp_text.cpp @@ -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(); }