Don't try to close empty polygon

Fixes #4337
This commit is contained in:
Jon Evans 2020-05-06 11:50:04 -04:00
parent 1f9723cf62
commit 528ebf8d7d
1 changed files with 4 additions and 1 deletions

View File

@ -557,7 +557,10 @@ bool GERBER_FILE_IMAGE::Execute_G_Command( char*& text, int G_command )
if( m_Exposure && GetLastItemInList() ) // End of polygon if( m_Exposure && GetLastItemInList() ) // End of polygon
{ {
GERBER_DRAW_ITEM * gbritem = GetLastItemInList(); GERBER_DRAW_ITEM * gbritem = GetLastItemInList();
gbritem->m_Polygon.Append( gbritem->m_Polygon.CVertex( 0 ) );
if( gbritem->m_Polygon.VertexCount() )
gbritem->m_Polygon.Append( gbritem->m_Polygon.CVertex( 0 ) );
StepAndRepeatItem( *gbritem ); StepAndRepeatItem( *gbritem );
} }
m_Exposure = false; m_Exposure = false;