Allow reading filled rectangles and circles from pcbnew files.

The internals have supported them for some time now.
This commit is contained in:
Jeff Young 2020-08-09 12:21:19 +01:00
parent e4c20e0ac9
commit f2d91862c7
1 changed files with 8 additions and 4 deletions

View File

@ -3026,11 +3026,15 @@ EDGE_MODULE* PCB_PARSER::parseEDGE_MODULE()
NeedRIGHT();
}
// Only filled polygons may have a zero-line width
// This is not permitted in KiCad but some external tools generate invalid
// files.
if( segment->GetShape() != S_POLYGON && segment->GetWidth() == 0 )
// Only filled shapes may have a zero-line width. While not permitted in KiCad, some
// external tools generate invalid files.
if( segment->GetShape() != S_RECT
&& segment->GetShape() != S_CIRCLE
&& segment->GetShape() != S_POLYGON
&& segment->GetWidth() == 0 )
{
segment->SetWidth( Millimeter2iu( DEFAULT_LINE_WIDTH ) );
}
return segment.release();
}