From 8a26bf6c418ff68271a392c3847d9543c89dcb2b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 11 Jan 2023 11:29:06 -0800 Subject: [PATCH] Tweak DNP display settings Use ERC error color Make lines 3 * default line width (instead of 4 *) --- eeschema/sch_painter.cpp | 12 ++++++++---- eeschema/sch_symbol.cpp | 21 ++++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index c43b96a00f..806941cf0d 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ #include #include #include +#include #include #include #include "sch_painter.h" @@ -2271,14 +2273,16 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer ) m_gal->SetIsStroke( true ); m_gal->SetIsFill( true ); - m_gal->SetStrokeColor( COLOR4D( 1.0, 0.0, 0.0, 1.0 ) ); - m_gal->SetFillColor( COLOR4D( 1.0, 0.0, 0.0, 1.0 ) ); + COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); + + m_gal->SetStrokeColor( colors->GetColor( LAYER_ERC_ERR ) ); + m_gal->SetFillColor( colors->GetColor( LAYER_ERC_ERR ) ); m_gal->DrawSegment( bbox.GetOrigin(), bbox.GetEnd(), - 4.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ); + 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ); m_gal->DrawSegment( bbox.GetOrigin() + VECTOR2I( bbox.GetWidth(), 0 ), bbox.GetOrigin() + VECTOR2I( 0, bbox.GetHeight() ), - 4.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ); + 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ); } } diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index db640daa71..b3a04ee70b 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include @@ -478,15 +480,17 @@ void SCH_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse { BOX2I bbox = GetBodyAndPinsBoundingBox(); wxDC* DC = aSettings->GetPrintDC(); + COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); + COLOR4D dnp_color = colors->GetColor( LAYER_ERC_ERR ); GRFilledSegment( DC, bbox.GetOrigin(), bbox.GetEnd(), - 4.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), - COLOR4D( 1.0, 0.0, 0.0, 1.0 ) ); + 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), + dnp_color ); GRFilledSegment( DC, bbox.GetOrigin() + VECTOR2I( bbox.GetWidth(), 0 ), bbox.GetOrigin() + VECTOR2I( 0, bbox.GetHeight() ), - 4.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), - COLOR4D( 1.0, 0.0, 0.0, 1.0 ) ); + 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), + dnp_color ); } } @@ -2153,15 +2157,18 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground ) const void SCH_SYMBOL::PlotDNP( PLOTTER* aPlotter ) const { BOX2I bbox = GetBodyAndPinsBoundingBox(); - aPlotter->SetColor( COLOR4D( 1.0, 0.0, 0.0, 1.0 ) ); + + COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); + + aPlotter->SetColor( colors->GetColor( LAYER_ERC_ERR ) ); aPlotter->ThickSegment( bbox.GetOrigin(), bbox.GetEnd(), - 4.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), + 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), FILLED, nullptr ); aPlotter->ThickSegment( bbox.GetOrigin() + VECTOR2I( bbox.GetWidth(), 0 ), bbox.GetOrigin() + VECTOR2I( 0, bbox.GetHeight() ), - 4.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), + 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), FILLED, nullptr ); }