Fix issues in ConvertOutlineToPolygon() related to S_POLYGON PCV_SHAPE

Fixes #7046
https://gitlab.com/kicad/code/kicad/issues/7046
This commit is contained in:
jean-pierre charras 2021-01-11 17:05:44 +01:00
parent be542c05f2
commit 1b755bbc37
1 changed files with 5 additions and 3 deletions

View File

@ -281,10 +281,10 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aSegList, SHAPE_POLY_SET&
double orientation = 0.0;
VECTOR2I offset = VECTOR2I( 0, 0 );
if( aSegList[0]->GetParentFootprint() )
if( graphic->GetParentFootprint() )
{
orientation = aSegList[0]->GetParentFootprint()->GetOrientation();
offset = aSegList[0]->GetParentFootprint()->GetPosition();
orientation = graphic->GetParentFootprint()->GetOrientation();
offset = graphic->GetParentFootprint()->GetPosition();
}
for( auto iter = poly.CIterate(); iter; iter++ )
@ -380,6 +380,8 @@ bool ConvertOutlineToPolygon( std::vector<PCB_SHAPE*>& aSegList, SHAPE_POLY_SET&
prevPt = (wxPoint) pt;
}
polygonComplete = true;
}
else
{