From 5f025dcd73f49f1dbf882a0d50318aa26ecd4c78 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Thu, 7 Sep 2023 03:50:00 +0300 Subject: [PATCH] SVG import: skip invisible shapes. --- pcbnew/import_gfx/svg_import_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/import_gfx/svg_import_plugin.cpp b/pcbnew/import_gfx/svg_import_plugin.cpp index 23c31241ad..8398f2c545 100644 --- a/pcbnew/import_gfx/svg_import_plugin.cpp +++ b/pcbnew/import_gfx/svg_import_plugin.cpp @@ -81,7 +81,10 @@ bool SVG_IMPORT_PLUGIN::Import() for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next ) { - double lineWidth = shape->strokeWidth; + if( !( shape->flags & NSVG_FLAGS_VISIBLE ) ) + continue; + + double lineWidth = shape->stroke.type != NSVG_PAINT_NONE ? shape->strokeWidth : -1; bool filled = shape->fill.type != NSVG_PAINT_NONE && alpha( shape->fill.color ) > 0; GRAPHICS_IMPORTER::POLY_FILL_RULE rule = GRAPHICS_IMPORTER::PF_NONZERO;