diff --git a/common/plotters/common_plot_functions.cpp b/common/plotters/common_plot_functions.cpp index 7c76c80420..91cd056285 100644 --- a/common/plotters/common_plot_functions.cpp +++ b/common/plotters/common_plot_functions.cpp @@ -112,8 +112,12 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL case WSG_RECT_T: { DS_DRAW_ITEM_RECT* rect = (DS_DRAW_ITEM_RECT*) item; - int penWidth = std::max( rect->GetPenWidth(), defaultPenWidth ); - plotter->Rect( rect->GetStart(), rect->GetEnd(), FILL_T::NO_FILL, penWidth ); + plotter->SetCurrentLineWidth( std::max( rect->GetPenWidth(), defaultPenWidth ) ); + plotter->MoveTo( rect->GetStart() ); + plotter->LineTo( VECTOR2I( rect->GetEnd().x, rect->GetStart().y ) ); + plotter->LineTo( VECTOR2I( rect->GetEnd().x, rect->GetEnd().y ) ); + plotter->LineTo( VECTOR2I( rect->GetStart().x, rect->GetEnd().y ) ); + plotter->FinishTo( rect->GetStart() ); } break; diff --git a/pcbnew/import_gfx/svg_import_plugin.cpp b/pcbnew/import_gfx/svg_import_plugin.cpp index 65b175234d..903aaea5d0 100644 --- a/pcbnew/import_gfx/svg_import_plugin.cpp +++ b/pcbnew/import_gfx/svg_import_plugin.cpp @@ -70,9 +70,16 @@ bool SVG_IMPORT_PLUGIN::Load( const wxString& aFileName ) bool SVG_IMPORT_PLUGIN::Import() { + auto alpha = + []( int color ) + { + return color >> 24; + }; + for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next ) { double lineWidth = shape->strokeWidth; + bool filled = shape->fill.type == NSVG_PAINT_COLOR && alpha( shape->fill.color ) > 0; GRAPHICS_IMPORTER::POLY_FILL_RULE rule = GRAPHICS_IMPORTER::PF_NONZERO; @@ -87,8 +94,9 @@ bool SVG_IMPORT_PLUGIN::Import() for( NSVGpath* path = shape->paths; path != nullptr; path = path->next ) { - DrawPath( path->pts, path->npts, path->closed || rule == GRAPHICS_IMPORTER::PF_EVEN_ODD, - shape->fill.type == NSVG_PAINT_COLOR, lineWidth ); + bool closed = path->closed || rule == GRAPHICS_IMPORTER::PF_EVEN_ODD; + + DrawPath( path->pts, path->npts, closed, filled, lineWidth ); } }