Tweak fill logic to also catch filled primitives in custom pad shapes.
This commit is contained in:
parent
ceb51bb103
commit
f21e308830
|
@ -584,13 +584,9 @@ BOARD* PCB_PARSER::parseBOARD_unchecked()
|
||||||
case T_gr_arc:
|
case T_gr_arc:
|
||||||
case T_gr_curve:
|
case T_gr_curve:
|
||||||
case T_gr_line:
|
case T_gr_line:
|
||||||
m_board->Add( parsePCB_SHAPE(), ADD_MODE::APPEND );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case T_gr_poly:
|
case T_gr_poly:
|
||||||
case T_gr_circle:
|
case T_gr_circle:
|
||||||
case T_gr_rect:
|
case T_gr_rect:
|
||||||
// these filled shapes are allowed and are filled if the line width = 0
|
|
||||||
m_board->Add( parsePCB_SHAPE(), ADD_MODE::APPEND );
|
m_board->Add( parsePCB_SHAPE(), ADD_MODE::APPEND );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2301,19 +2297,17 @@ PCB_SHAPE* PCB_PARSER::parsePCB_SHAPE()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// In legacy versions there was no option for polygon filling and all polygons
|
if( !foundFill )
|
||||||
// were considered filled if they were on a layer othar than the edge cuts.
|
|
||||||
// So if there was no (fill ) section in the sexpr for a polygon, assume the polygon is filled.
|
|
||||||
if( !foundFill && ( shape->GetShape() == S_POLYGON ) && ( shape->GetLayer() != Edge_Cuts ) )
|
|
||||||
shape->SetFilled( true );
|
|
||||||
|
|
||||||
// Legacy versions didn't have a filled flag but allowed some shapes to indicate they
|
|
||||||
// should be filled by specifying a 0 stroke-width.
|
|
||||||
if( m_requiredVersion <= 20201002 )
|
|
||||||
{
|
{
|
||||||
if( shape->GetWidth() == 0 && ( shape->GetShape() == S_RECT
|
// Legacy versions didn't have a filled flag but allowed some shapes to indicate they
|
||||||
|| shape->GetShape() == S_CIRCLE
|
// should be filled by specifying a 0 stroke-width.
|
||||||
|| shape->GetShape() == S_POLYGON ) )
|
if( shape->GetWidth() == 0
|
||||||
|
&& ( shape->GetShape() == S_RECT || shape->GetShape() == S_CIRCLE ) )
|
||||||
|
{
|
||||||
|
shape->SetFilled( true );
|
||||||
|
}
|
||||||
|
// Polygons on non-Edge_Cuts layers were always filled
|
||||||
|
else if( shape->GetShape() == S_POLYGON && shape->GetLayer() != Edge_Cuts )
|
||||||
{
|
{
|
||||||
shape->SetFilled( true );
|
shape->SetFilled( true );
|
||||||
}
|
}
|
||||||
|
@ -3469,13 +3463,7 @@ FP_SHAPE* PCB_PARSER::parseFP_SHAPE()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// In legacy versions there was no option for polygon filling and all polygons
|
if( !foundFill )
|
||||||
// were considered filled if they were on a layer othar than the edge cuts.
|
|
||||||
// So if there was no (fill ) section in the sexpr for a polygon, assume the polygon is filled.
|
|
||||||
if( !foundFill && ( shape->GetShape() == S_POLYGON ) && ( shape->GetLayer() != Edge_Cuts ) )
|
|
||||||
shape->SetFilled( true );
|
|
||||||
|
|
||||||
if( m_requiredVersion <= 20201002 )
|
|
||||||
{
|
{
|
||||||
// Legacy versions didn't have a filled flag but allowed some shapes to indicate they
|
// Legacy versions didn't have a filled flag but allowed some shapes to indicate they
|
||||||
// should be filled by specifying a 0 stroke-width.
|
// should be filled by specifying a 0 stroke-width.
|
||||||
|
@ -3484,6 +3472,11 @@ FP_SHAPE* PCB_PARSER::parseFP_SHAPE()
|
||||||
{
|
{
|
||||||
shape->SetFilled( true );
|
shape->SetFilled( true );
|
||||||
}
|
}
|
||||||
|
// Polygons on non-Edge_Cuts layers were always filled
|
||||||
|
else if( shape->GetShape() == S_POLYGON && shape->GetLayer() != Edge_Cuts )
|
||||||
|
{
|
||||||
|
shape->SetFilled( true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only filled shapes may have a zero line-width. This is not permitted in KiCad but some
|
// Only filled shapes may have a zero line-width. This is not permitted in KiCad but some
|
||||||
|
|
Loading…
Reference in New Issue