diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 3ae2a38092..8f56a71d6b 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -804,8 +804,10 @@ void SVG_PLOTTER::Text( const wxPoint& aPos, } wxSize text_size; - text_size.x = GraphicTextWidth( aText, aSize, aItalic, width ); - text_size.y = aSize.x * 4/3; // Hershey font height to em size conversion + // aSize.x or aSize.y is < 0 for mirrored texts. + // The actual text size value is the absolue value + text_size.x = std::abs( GraphicTextWidth( aText, aSize, aItalic, width ) ); + text_size.y = std::abs( aSize.x * 4/3 ); // Hershey font height to em size conversion DPOINT anchor_pos_dev = userToDeviceCoordinates( aPos ); DPOINT text_pos_dev = userToDeviceCoordinates( text_pos ); DPOINT sz_dev = userToDeviceSize( text_size );