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
This commit is contained in:
parent
1090403ca2
commit
018f4531a5
|
@ -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…
Reference in New Issue