From 1e151b1bcbed51e77866460654b6e1d20ef66834 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 12 Nov 2021 16:27:08 +0000 Subject: [PATCH] Fix effective pen width when plotting wires. Fixes https://gitlab.com/kicad/code/kicad/issues/9625 --- eeschema/dialogs/dialog_plot_schematic.cpp | 2 +- eeschema/sch_line.cpp | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index 8fd3a73719..2f443c137d 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -345,7 +345,7 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions( RENDER_SETTINGS* aSettings ) } aSettings->LoadColors( colors ); - aSettings->SetDefaultPenWidth( (int) m_defaultLineWidth.GetValue() ); + aSettings->SetMinPenWidth( (int) m_defaultLineWidth.GetValue() ); if( m_plotBackgroundColor->GetValue() ) aSettings->SetBackgroundColor( colors->GetColor( LAYER_SCHEMATIC_BACKGROUND ) ); diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 8d2e975f24..f932b3a9b8 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -833,7 +833,7 @@ bool SCH_LINE::doIsConnected( const wxPoint& aPosition ) const void SCH_LINE::Plot( PLOTTER* aPlotter ) const { auto* settings = static_cast( aPlotter->RenderSettings() ); - int penWidth; + int penWidth = std::max( GetPenWidth(), settings->GetMinPenWidth() ); COLOR4D color = GetLineColor(); if( color == COLOR4D::UNSPECIFIED ) @@ -841,18 +841,6 @@ void SCH_LINE::Plot( PLOTTER* aPlotter ) const aPlotter->SetColor( color ); - switch( m_layer ) - { - case LAYER_WIRE: penWidth = settings->m_DefaultWireThickness; break; - case LAYER_BUS: penWidth = settings->m_DefaultBusThickness; break; - default: penWidth = GetPenWidth(); break; - } - - if( m_stroke.GetWidth() != 0 ) - penWidth = m_stroke.GetWidth(); - - penWidth = std::max( penWidth, settings->GetMinPenWidth() ); - aPlotter->SetCurrentLineWidth( penWidth ); aPlotter->SetDash( GetEffectiveLineStyle() );