Mirror hidden text in SVG plotter

We output a 0 opacity text in the SVG plotter to allow searching.  When
this text is changed to 100 opacity, it can show up on the user screen
and so needs to be mirrored to match the stroke font output

Fixes https://gitlab.com/kicad/code/kicad/issues/5001

(cherry picked from commit b650e4568b)
This commit is contained in:
Seth Hillbrand 2020-07-30 06:16:04 -07:00
parent 77d7d21130
commit bce8fb31ab
1 changed files with 7 additions and 2 deletions

View File

@ -796,10 +796,15 @@ void SVG_PLOTTER::Text( const wxPoint& aPos,
}
fprintf( outputFile,
"<text x=\"%g\" y=\"%g\"\n"
"<text x=\"%g\" y=\"%g\"\n", text_pos_dev.x, text_pos_dev.y );
/// If the text is mirrored, we should also mirror the hidden text to match
if( aSize.x < 0 )
fprintf( outputFile, "transform=\"scale(-1 1) translate(%f 0)\"\n", -2 * text_pos_dev.x );
fprintf( outputFile,
"textLength=\"%g\" font-size=\"%g\" lengthAdjust=\"spacingAndGlyphs\"\n"
"text-anchor=\"%s\" opacity=\"0\">%s</text>\n",
text_pos_dev.x, text_pos_dev.y,
sz_dev.x, sz_dev.y,
hjust, TO_UTF8( XmlEsc( aText ) ) );