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

@ -705,7 +705,7 @@ void LIB_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse
void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackground,
const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed ) const
const VECTOR2I &aOffset, const TRANSFORM &aTransform, bool aDimmed ) const
{
wxASSERT( aPlotter != nullptr );
@ -726,8 +726,8 @@ void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackgro
if( item.IsPrivate() )
continue;
// Lib Fields are not plotted here, because this plot function
// is used to plot schematic items, which have they own fields
// LIB_FIELDs are not plotted here, because this plot function is used to plot schematic
// items which have their own SCH_FIELDs
if( item.Type() == LIB_FIELD_T )
continue;

View File

@ -382,8 +382,13 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
return;
}
VECTOR2I start = aTransform.TransformCoordinate( m_start ) + aOffset;
VECTOR2I end = aTransform.TransformCoordinate( m_end ) + aOffset;
VECTOR2I start = aTransform.TransformCoordinate( m_start ) + 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() );
COLOR4D color = GetStroke().GetColor();
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 )
lineStyle = PLOT_DASH_TYPE::DASH;
if( aDimmed )
color = color.Mix( bg, 0.5f );
aPlotter->SetColor( color );
aPlotter->SetDash( penWidth, lineStyle );
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 )
color = aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE );
COLOR4D bg = aPlotter->RenderSettings()->GetBackgroundColor();
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )
bg = COLOR4D::WHITE;
if( aDimmed )
color = color.Mix( bg, 0.5f );

View File

@ -2155,7 +2155,7 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground ) const
for( bool local_background : { true, false } )
{
tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), local_background, m_pos, temp,
GetDNP() );
GetDNP() );
for( SCH_FIELD field : m_fields )
field.Plot( aPlotter, local_background );