diff --git a/common/plotters/PS_plotter.cpp b/common/plotters/PS_plotter.cpp index 1e2e3fa770..d657282fa8 100644 --- a/common/plotters/PS_plotter.cpp +++ b/common/plotters/PS_plotter.cpp @@ -112,7 +112,7 @@ void PSLIKE_PLOTTER::FlashPadOval( const VECTOR2I& aPadPos, const VECTOR2I& aSiz RotatePoint( a, orient ); RotatePoint( b, orient ); - ThickSegment( a + aPadPos, b + aPadPos, size.x, aTraceMode, nullptr ); + ThickSegment( a + aPadPos, b + aPadPos, size.x, aTraceMode, aData ); } @@ -155,7 +155,7 @@ void PSLIKE_PLOTTER::FlashPadRect( const VECTOR2I& aPadPos, const VECTOR2I& aSiz cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0 ); + PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0, aData ); } @@ -179,7 +179,7 @@ void PSLIKE_PLOTTER::FlashPadRoundRect( const VECTOR2I& aPadPos, const VECTOR2I& // Close polygon cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0 ); + PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0, aData ); } @@ -200,7 +200,7 @@ void PSLIKE_PLOTTER::FlashPadCustom( const VECTOR2I& aPadPos, const VECTOR2I& aS // Close polygon cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0 ); + PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0, aData ); } } @@ -222,7 +222,7 @@ void PSLIKE_PLOTTER::FlashPadTrapez( const VECTOR2I& aPadPos, const VECTOR2I* aC } cornerList.push_back( cornerList[0] ); - PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0 ); + PlotPoly( cornerList, FILL_T::FILLED_SHAPE, 0, aData ); } diff --git a/common/plotters/common_plot_functions.cpp b/common/plotters/common_plot_functions.cpp index 113c531324..9b495085bf 100644 --- a/common/plotters/common_plot_functions.cpp +++ b/common/plotters/common_plot_functions.cpp @@ -69,7 +69,7 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL wxFileName fn( aFilename ); // Prepare plot parameters - drawList.SetDefaultPenSize( PLOTTER::USE_DEFAULT_LINE_WIDTH ); + drawList.SetDefaultPenSize( defaultPenWidth ); drawList.SetPlotterMilsToIUfactor( iusPerMil ); drawList.SetPageNumber( aSheetNumber ); drawList.SetSheetCount( aSheetCount ); @@ -97,7 +97,7 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL continue; bitmap->m_ImageBitmap->PlotImage( plotter, drawItem->GetPosition(), plotColor, - PLOTTER::USE_DEFAULT_LINE_WIDTH ); + defaultPenWidth ); } } @@ -108,7 +108,6 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL continue; plotter->SetColor( plotColor ); - plotter->SetCurrentLineWidth( PLOTTER::USE_DEFAULT_LINE_WIDTH ); switch( item->Type() ) { @@ -118,8 +117,8 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL plotter->SetCurrentLineWidth( std::max( line->GetPenWidth(), defaultPenWidth ) ); plotter->MoveTo( line->GetStart() ); plotter->FinishTo( line->GetEnd() ); + break; } - break; case WSG_RECT_T: { @@ -130,8 +129,8 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL plotter->LineTo( VECTOR2I( rect->GetEnd().x, rect->GetEnd().y ) ); plotter->LineTo( VECTOR2I( rect->GetStart().x, rect->GetEnd().y ) ); plotter->FinishTo( rect->GetStart() ); + break; } - break; case WSG_TEXT_T: { @@ -154,13 +153,13 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL text->GetTextAngle(), text->GetTextSize(), text->GetHorizJustify(), text->GetVertJustify(), penWidth, text->IsItalic(), text->IsBold(), text->IsMultilineAllowed(), font, text->GetFontMetrics() ); + break; } - break; case WSG_POLY_T: { DS_DRAW_ITEM_POLYPOLYGONS* poly = (DS_DRAW_ITEM_POLYPOLYGONS*) item; - int penWidth = poly->GetPenWidth(); + int penWidth = std::max( poly->GetPenWidth(), defaultPenWidth ); std::vector points; for( int idx = 0; idx < poly->GetPolygons().OutlineCount(); ++idx ) @@ -171,12 +170,15 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL for( int ii = 0; ii < outline.PointCount(); ii++ ) points.emplace_back( outline.CPoint( ii ).x, outline.CPoint( ii ).y ); - plotter->PlotPoly( points, FILL_T::FILLED_SHAPE, penWidth ); + plotter->PlotPoly( points, FILL_T::FILLED_SHAPE, penWidth, nullptr ); } - } - break; - default: wxFAIL_MSG( wxT( "PlotDrawingSheet(): Unknown drawing sheet item." ) ); break; + break; + } + + default: + wxFAIL_MSG( wxT( "PlotDrawingSheet(): Unknown drawing sheet item." ) ); + break; } } } diff --git a/common/plotters/plotter.cpp b/common/plotters/plotter.cpp index 43105c17af..8119120d7e 100644 --- a/common/plotters/plotter.cpp +++ b/common/plotters/plotter.cpp @@ -295,7 +295,7 @@ void PLOTTER::markerSquare( const VECTOR2I& position, int radius ) corner.y = position.y + r; corner_list.push_back( corner ); - PlotPoly( corner_list, FILL_T::NO_FILL, GetCurrentLineWidth() ); + PlotPoly( corner_list, FILL_T::NO_FILL, GetCurrentLineWidth(), nullptr ); } @@ -328,7 +328,7 @@ void PLOTTER::markerLozenge( const VECTOR2I& position, int radius ) corner.y = position.y + radius; corner_list.push_back( corner ); - PlotPoly( corner_list, FILL_T::NO_FILL, GetCurrentLineWidth() ); + PlotPoly( corner_list, FILL_T::NO_FILL, GetCurrentLineWidth(), nullptr ); } diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index 2172ee1e80..9bb6b473b8 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -1342,7 +1342,7 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_O else { if( !s_poly.empty() ) - aPlotter->PlotPoly( s_poly, FILL_T::NO_FILL, penWidth ); + aPlotter->PlotPoly( s_poly, FILL_T::NO_FILL, penWidth, nullptr ); } // Make sheet pins and hierarchical labels clickable hyperlinks diff --git a/eeschema/sch_rule_area.cpp b/eeschema/sch_rule_area.cpp index 61cb070024..67e5f9f0a0 100644 --- a/eeschema/sch_rule_area.cpp +++ b/eeschema/sch_rule_area.cpp @@ -186,7 +186,7 @@ void SCH_RULE_AREA::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OP aPlotter->SetCurrentLineWidth( pen_size ); aPlotter->SetDash( pen_size, lineStyle ); - aPlotter->PlotPoly( ptList, fill, pen_size ); + aPlotter->PlotPoly( ptList, fill, pen_size, nullptr ); aPlotter->SetDash( pen_size, LINE_STYLE::SOLID ); } diff --git a/eeschema/sch_shape.cpp b/eeschema/sch_shape.cpp index 23c0bfe82a..dd3e1e2eb4 100644 --- a/eeschema/sch_shape.cpp +++ b/eeschema/sch_shape.cpp @@ -252,7 +252,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& if( aBackground && IsHatchedFill() ) { for( int ii = 0; ii < GetHatching().OutlineCount(); ++ii ) - aPlotter->PlotPoly( GetHatching().COutline( ii ), FILL_T::FILLED_SHAPE, 0 ); + aPlotter->PlotPoly( GetHatching().COutline( ii ), FILL_T::FILLED_SHAPE, 0, nullptr ); return; } @@ -282,7 +282,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& case SHAPE_T::POLY: case SHAPE_T::BEZIER: - aPlotter->PlotPoly( ptList, fill, pen_size ); + aPlotter->PlotPoly( ptList, fill, pen_size, nullptr ); break; default: diff --git a/include/plotters/plotter.h b/include/plotters/plotter.h index 904b96fecb..88bf4c905c 100644 --- a/include/plotters/plotter.h +++ b/include/plotters/plotter.h @@ -272,8 +272,8 @@ public: * @param aWidth is the line width. * @param aData is an auxiliary info (mainly for gerber format). */ - virtual void PlotPoly( const std::vector& aCornerList, FILL_T aFill, - int aWidth = USE_DEFAULT_LINE_WIDTH, void* aData = nullptr ) = 0; + virtual void PlotPoly( const std::vector& aCornerList, FILL_T aFill, int aWidth, + void* aData ) = 0; /** * Draw a polygon ( filled or not ). @@ -284,8 +284,8 @@ public: * @param aWidth is the line width. * @param aData is an auxiliary info (mainly for gerber format). */ - virtual void PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill, - int aWidth = USE_DEFAULT_LINE_WIDTH, void* aData = nullptr ); + virtual void PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill, int aWidth, + void* aData ); /** * Only PostScript plotters can plot bitmaps. @@ -612,14 +612,6 @@ protected: // Helper function for sketched filler segment - /** - * Convert a thick segment and plot it as an oval - */ - void segmentAsOval( const VECTOR2I& start, const VECTOR2I& end, int width, - OUTLINE_MODE tracemode ); - - void sketchOval( const VECTOR2I& aPos, const VECTOR2I& aSize, const EDA_ANGLE& aOrient, - int aWidth ); // Coordinate and scaling conversion functions