Browse Source

Fixes in the SVG import polygon postprocessing:

- don't drop subsequent polys when a non-filled primitive is imported 'in between'
- fix missing holes (also related to the interleaving of stroke and filled shapes, depending on the software that wrote the SVG file)

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/10813
7.0
Tomasz Wlostowski 4 years ago
parent
commit
018f4531a5
  1. 7
      pcbnew/import_gfx/graphics_importer_buffer.cpp

7
pcbnew/import_gfx/graphics_importer_buffer.cpp

@ -172,7 +172,7 @@ static void convertPolygon( std::list<std::unique_ptr<IMPORTED_SHAPE>>& aShapes,
void GRAPHICS_IMPORTER_BUFFER::PostprocessNestedPolygons()
{
int curShapeIdx = 0;
int curShapeIdx = -1;
int lastWidth = 1;
std::list<std::unique_ptr<IMPORTED_SHAPE>> newShapes;
@ -191,11 +191,14 @@ void GRAPHICS_IMPORTER_BUFFER::PostprocessNestedPolygons()
lastWidth = poly->GetWidth();
int index = poly->GetParentShapeIndex();
if( curShapeIdx < 0 )
index = curShapeIdx;
if( index == curShapeIdx )
{
polypaths.push_back( poly );
}
else if( index == curShapeIdx + 1 )
else if( index >= curShapeIdx + 1 )
{
convertPolygon( newShapes, polypaths, m_shapeFillRules[curShapeIdx], lastWidth );
curShapeIdx++;

Loading…
Cancel
Save