Dim DNP textbox borders.
Fixes https://gitlab.com/kicad/code/kicad/issues/12709
This commit is contained in:
parent
bad410948d
commit
c9ce8da10a
|
@ -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,
|
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 );
|
wxASSERT( aPlotter != nullptr );
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -382,8 +382,13 @@ void LIB_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const VECTOR2I& aOf
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 );
|
||||||
|
|
||||||
|
|
|
@ -2155,7 +2155,7 @@ void SCH_SYMBOL::Plot( PLOTTER* aPlotter, bool aBackground ) const
|
||||||
for( bool local_background : { true, false } )
|
for( bool local_background : { true, false } )
|
||||||
{
|
{
|
||||||
tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), local_background, m_pos, temp,
|
tempSymbol.Plot( aPlotter, GetUnit(), GetConvert(), local_background, m_pos, temp,
|
||||||
GetDNP() );
|
GetDNP() );
|
||||||
|
|
||||||
for( SCH_FIELD field : m_fields )
|
for( SCH_FIELD field : m_fields )
|
||||||
field.Plot( aPlotter, local_background );
|
field.Plot( aPlotter, local_background );
|
||||||
|
|
Loading…
Reference in New Issue