From 184bcf652081b3334dca0b1182a400ad66475e23 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 11 Jan 2022 17:39:25 +0000 Subject: [PATCH] Fix failure of SCH_SHAPE to pick up default line width. Fixes https://gitlab.com/kicad/code/kicad/issues/10376 --- eeschema/sch_shape.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_shape.cpp b/eeschema/sch_shape.cpp index 136ebf0740..40d847e317 100644 --- a/eeschema/sch_shape.cpp +++ b/eeschema/sch_shape.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -190,11 +191,19 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter ) const int SCH_SHAPE::GetPenWidth() const { + if( m_stroke.GetWidth() > 0 ) + return GetWidth(); + // Historically 0 meant "default width" and negative numbers meant "don't stroke". if( GetWidth() < 0 && GetFillMode() != FILL_T::NO_FILL ) return 0; - else - return std::max( GetWidth(), 1 ); + + SCHEMATIC* schematic = Schematic(); + + if( schematic ) + return schematic->Settings().m_DefaultLineWidth; + + return Mils2iu( DEFAULT_LINE_WIDTH_MILS ); }