Dim DNP textbox borders.

Fixes https://gitlab.com/kicad/code/kicad/issues/12709
This commit is contained in:
Jeff Young 2022-10-21 22:28:31 +01:00
parent bad410948d
commit c9ce8da10a
3 changed files with 14 additions and 11 deletions

View File

@ -726,8 +726,8 @@ void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackgro
if( item.IsPrivate() ) if( item.IsPrivate() )
continue; continue;
// Lib Fields are not plotted here, because this plot function // LIB_FIELDs are not plotted here, because this plot function is used to plot schematic
// is used to plot schematic items, which have they own fields // items which have their own SCH_FIELDs
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;

View File

@ -384,6 +384,11 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
VECTOR2I start = aTransform.TransformCoordinate( m_start ) + aOffset; VECTOR2I start = aTransform.TransformCoordinate( m_start ) + aOffset;
VECTOR2I end = aTransform.TransformCoordinate( m_end ) + aOffset; VECTOR2I end = aTransform.TransformCoordinate( m_end ) + aOffset;
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
bg = COLOR4D::WHITE;
int penWidth = GetEffectivePenWidth( aPlotter->RenderSettings() ); int penWidth = GetEffectivePenWidth( aPlotter->RenderSettings() );
COLOR4D color = GetStroke().GetColor(); COLOR4D color = GetStroke().GetColor();
PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle(); PLOT_DASH_TYPE lineStyle = GetStroke().GetPlotStyle();
@ -396,6 +401,9 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
if( lineStyle == PLOT_DASH_TYPE::DEFAULT ) if( lineStyle == PLOT_DASH_TYPE::DEFAULT )
lineStyle = PLOT_DASH_TYPE::DASH; lineStyle = PLOT_DASH_TYPE::DASH;
if( aDimmed )
color = color.Mix( bg, 0.5f );
aPlotter->SetColor( color ); aPlotter->SetColor( color );
aPlotter->SetDash( penWidth, lineStyle ); aPlotter->SetDash( penWidth, lineStyle );
aPlotter->Rect( start, end, FILL_T::NO_FILL, penWidth ); aPlotter->Rect( start, end, FILL_T::NO_FILL, penWidth );
@ -409,11 +417,6 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED ) if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ); color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE );
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
bg = COLOR4D::WHITE;
if( aDimmed ) if( aDimmed )
color = color.Mix( bg, 0.5f ); color = color.Mix( bg, 0.5f );