diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index e46e9c3577..83e88cf1e4 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -777,8 +777,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 );