From f0ce4d633620454f008931faeefe13156320e604 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 19 May 2019 19:33:27 -0700 Subject: [PATCH] eagle: Use width on imported lines if available If not, use the current board design settings for line thickness based on the board layer. (cherry picked from commit c80e3e0ffc40788de3471b8e1cf3cfc304cb4214) --- pcbnew/eagle_plugin.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 2f509daa99..ad2f721cb2 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -495,6 +495,12 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) if( layer != UNDEFINED_LAYER ) { DRAWSEGMENT* dseg = new DRAWSEGMENT( m_board ); + int width = w.width.ToPcbUnits(); + + // KiCad cannot handle zero or negative line widths + if( width <= 0 ) + width = m_board->GetDesignSettings().GetLineThickness( layer ); + m_board->Add( dseg, ADD_APPEND ); if( !w.curve ) @@ -514,8 +520,9 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) dseg->SetTimeStamp( EagleTimeStamp( gr ) ); dseg->SetLayer( layer ); - dseg->SetWidth( Millimeter2iu( DEFAULT_PCB_EDGE_THICKNESS ) ); + dseg->SetWidth( width ); } + m_xpath->pop(); } else if( grName == "text" )