From 9c62792245d12e397053e8896f3b2e3f5bdd10e4 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 8 Mar 2018 22:44:26 -0500 Subject: [PATCH] SVG Plotter: Handle edge-case arc and circle drawing --- common/plotters/SVG_plotter.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 66248c6b07..a106b67c19 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -357,6 +357,15 @@ void SVG_PLOTTER::Circle( const wxPoint& pos, int diametre, FILL_T fill, int wid setFillMode( fill ); SetCurrentLineWidth( width ); + // If diameter is less than width, switch to filled mode + if( fill == NO_FILL && diametre < width ) + { + setFillMode( FILLED_SHAPE ); + SetCurrentLineWidth( 0 ); + + radius = userToDeviceSize( ( diametre / 2.0 ) + ( width / 2.0 ) ); + } + fprintf( outputFile, " \n", pos_dev.x, pos_dev.y, radius ); @@ -375,7 +384,10 @@ void SVG_PLOTTER::Arc( const wxPoint& centre, double StAngle, double EndAngle, i */ if( radius <= 0 ) + { + Circle( centre, width, FILLED_SHAPE, 0 ); return; + } if( StAngle > EndAngle ) std::swap( StAngle, EndAngle );