diff --git a/gerbview/gerber_draw_item.h b/gerbview/gerber_draw_item.h index dbb4f64080..6f4ad819ee 100644 --- a/gerbview/gerber_draw_item.h +++ b/gerbview/gerber_draw_item.h @@ -89,8 +89,7 @@ public: // Lines : m_Size.x = m_Size.y = line width bool m_Flashed; // True for flashed items int m_DCode; // DCode used to draw this item. - // 0 for items that do not use DCodes (polygons) - // or when unknown and normal values are 10 to 999 + // Allowed values are 10 to 999. 0 when unknown // values 0 to 9 can be used for special purposes GERBER_FILE_IMAGE* m_GerberImageFile; /* Gerber file image source of this item * Note: some params stored in this class are common diff --git a/gerbview/rs274d.cpp b/gerbview/rs274d.cpp index de0c605cf9..145bb51bf4 100644 --- a/gerbview/rs274d.cpp +++ b/gerbview/rs274d.cpp @@ -619,6 +619,14 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande ) m_Drawings.Append( gbritem ); gbritem->m_Shape = GBR_POLYGON; gbritem->m_Flashed = false; + + tool = GetDCODE( m_Current_Tool ); + + if( tool ) + gbritem->m_DCode = tool->m_Num_Dcode; + + if( gbritem->m_GerberImageFile ) + gbritem->SetNetAttributes( gbritem->m_GerberImageFile->m_NetAttributeDict ); } switch( m_Iterpolation ) @@ -676,6 +684,7 @@ bool GERBER_FILE_IMAGE::Execute_DCODE_Command( char*& text, int D_commande ) m_Exposure = true; tool = GetDCODE( m_Current_Tool ); + if( tool ) { size = tool->m_Size;