diff --git a/common/plotters/HPGL_plotter.cpp b/common/plotters/HPGL_plotter.cpp index c6dd75c86e..15fa21bbfd 100644 --- a/common/plotters/HPGL_plotter.cpp +++ b/common/plotters/HPGL_plotter.cpp @@ -465,7 +465,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector& aCornerList, FILL_T aF MoveTo( aCornerList[0] ); startItem( userToDeviceCoordinates( aCornerList[0] ) ); - if( aFill == FILL_T::FILLED_SHAPE ) + if( aFill == FILL_T::FILLED_SHAPE || aFill == FILL_T::FILLED_WITH_COLOR ) { // Draw the filled area SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 9a76b18f9c..19ea834d25 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -222,6 +222,9 @@ void PDF_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int { wxASSERT( m_workFile ); + if( fill == FILL_T::NO_FILL && width <= 0 ) + return; + SetCurrentLineWidth( width ); VECTOR2I size = p2 - p1; @@ -229,8 +232,6 @@ void PDF_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int if( size.x == 0 && size.y == 0 ) { // Can't draw zero-sized rectangles - SetCurrentLineWidth( width ); - MoveTo( VECTOR2I( p1.x, p1.y ) ); FinishTo( VECTOR2I( p1.x, p1.y ) ); @@ -256,14 +257,25 @@ void PDF_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int VECTOR2D p1_dev = userToDeviceCoordinates( p1 ); VECTOR2D p2_dev = userToDeviceCoordinates( p2 ); + char paintOp; + + if( fill == FILL_T::NO_FILL ) + paintOp = 'S'; + else + paintOp = width > 0 ? 'B' : 'f'; + fprintf( m_workFile, "%g %g %g %g re %c\n", p1_dev.x, p1_dev.y, p2_dev.x - p1_dev.x, - p2_dev.y - p1_dev.y, fill == FILL_T::NO_FILL ? 'S' : 'B' ); + p2_dev.y - p1_dev.y, paintOp ); } void PDF_PLOTTER::Circle( const VECTOR2I& pos, int diametre, FILL_T aFill, int width ) { wxASSERT( m_workFile ); + + if( aFill == FILL_T::NO_FILL && width <= 0 ) + return; + VECTOR2D pos_dev = userToDeviceCoordinates( pos ); double radius = userToDeviceSize( diametre / 2.0 ); diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index 0b3e1d88a1..981789fe72 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -496,6 +496,9 @@ void PS_PLOTTER::SetDash( int aLineWidth, PLOT_DASH_TYPE aLineStyle ) void PS_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int width ) { + if( fill == FILL_T::NO_FILL && width <= 0 ) + return; + VECTOR2D p1_dev = userToDeviceCoordinates( p1 ); VECTOR2D p2_dev = userToDeviceCoordinates( p2 ); @@ -507,6 +510,9 @@ void PS_PLOTTER::Rect( const VECTOR2I& p1, const VECTOR2I& p2, FILL_T fill, int void PS_PLOTTER::Circle( const VECTOR2I& pos, int diametre, FILL_T fill, int width ) { + if( fill == FILL_T::NO_FILL && width <= 0 ) + return; + wxASSERT( m_outputFile ); VECTOR2D pos_dev = userToDeviceCoordinates( pos ); double radius = userToDeviceSize( diametre / 2.0 ); diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 4456b08514..46a5343416 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -220,68 +220,77 @@ void SVG_PLOTTER::setSVGPlotStyle( int aLineWidth, bool aIsGroup, const std::str if( aIsGroup ) fputs( "\nRenderSettings()->GetMinPenWidth() ); + int pen_size = GetPenWidth(); + + if( pen_size > 0 ) + pen_size = std::max( pen_size, aPlotter->RenderSettings()->GetMinPenWidth() ); static std::vector cornerList; @@ -185,15 +188,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground ) const break; case SHAPE_T::RECTANGLE: - { - std::vector pts = GetRectCorners(); - - aPlotter->MoveTo( pts[0] ); - aPlotter->LineTo( pts[1] ); - aPlotter->LineTo( pts[2] ); - aPlotter->LineTo( pts[3] ); - aPlotter->FinishTo( pts[0] ); - } + aPlotter->Rect( GetStart(), GetEnd(), FILL_T::NO_FILL, pen_size ); break; case SHAPE_T::POLY: