From 34742b386d44351831ea4a25c524f81de447a5c0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 21 Oct 2022 22:55:01 +0100 Subject: [PATCH] Honour dimming when printing fields. Fixes https://gitlab.com/kicad/code/kicad/issues/12708 --- eeschema/sch_field.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 51a50b2808..38259038aa 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -336,6 +336,14 @@ void SCH_FIELD::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset if( ( !IsVisible() && !IsForceVisible() ) || IsVoid() ) return; + COLOR4D bg = aSettings->GetBackgroundColor(); + + if( bg == COLOR4D::UNSPECIFIED || GetGRForceBlackPenState() ) + bg = COLOR4D::WHITE; + + if( IsForceVisible() ) + bg = aSettings->GetLayerColor( LAYER_HIDDEN ); + if( !blackAndWhiteMode && GetTextColor() != COLOR4D::UNSPECIFIED ) color = GetTextColor(); @@ -353,6 +361,9 @@ void SCH_FIELD::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset else orient = ANGLE_HORIZONTAL; } + + if( parentSymbol && parentSymbol->GetDNP() ) + color = color.Mix( bg, 0.5f ); } /*