From b0ebc476d21e810822244f8d875c88fcfe9fcbf7 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 29 May 2020 15:24:58 -0400 Subject: [PATCH] Don't assert when getting line width for sheets --- eeschema/sch_painter.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 5a19fa461e..3a659fdca3 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -313,22 +313,19 @@ float SCH_PAINTER::getLineWidth( const LIB_ITEM* aItem, bool aDrawingShadows ) float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) { - wxCHECK( aItem && aItem->Type() == SCH_LINE_T, - static_cast( m_schSettings.m_DefaultWireThickness ) ); + wxCHECK( aItem, static_cast( m_schSettings.m_DefaultWireThickness ) ); float width; const SCH_LINE* line = dynamic_cast( aItem ); - wxCHECK( line, static_cast( m_schSettings.m_DefaultWireThickness ) ); - - if( aItem->GetLayer() == LAYER_WIRE ) + if( line && aItem->GetLayer() == LAYER_WIRE ) { if( line->GetLineSize() != 0 ) width = (float) line->GetLineSize(); else width = (float) m_schSettings.m_DefaultWireThickness; } - else if( aItem->GetLayer() == LAYER_BUS ) + else if( line && aItem->GetLayer() == LAYER_BUS ) { if( line->GetLineSize() != 0 ) width = (float) line->GetLineSize();