SVG plotter: fix hidden text orientation when plot is mirrored.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15422
This commit is contained in:
Alex Shvartzkop 2023-08-16 10:42:59 +03:00
parent ea65a5a80b
commit 556120554e
1 changed files with 4 additions and 4 deletions

View File

@ -828,16 +828,16 @@ void SVG_PLOTTER::Text( const VECTOR2I& aPos,
if( !aOrient.IsZero() )
{
fprintf( m_outputFile,
"<g transform=\"rotate(%f %.*f %.*f)\">\n",
- aOrient.AsDegrees(), m_precision, anchor_pos_dev.x, m_precision, anchor_pos_dev.y );
fprintf( m_outputFile, "<g transform=\"rotate(%f %.*f %.*f)\">\n",
m_plotMirror ? aOrient.AsDegrees() : -aOrient.AsDegrees(), m_precision,
anchor_pos_dev.x, m_precision, anchor_pos_dev.y );
}
fprintf( m_outputFile, "<text x=\"%.*f\" y=\"%.*f\"\n",
m_precision, text_pos_dev.x, m_precision, text_pos_dev.y );
/// If the text is mirrored, we should also mirror the hidden text to match
if( aSize.x < 0 )
if( m_plotMirror != ( aSize.x < 0 ) )
fprintf( m_outputFile, "transform=\"scale(-1 1) translate(%f 0)\"\n", -2 * text_pos_dev.x );
fprintf( m_outputFile,