Respect default layer color for textbox borders.

Fixes https://gitlab.com/kicad/code/kicad/issues/11497
This commit is contained in:
Jeff Young 2022-04-29 14:10:22 +01:00
parent dc1e063b00
commit 9fbf8e6f5d
1 changed files with 12 additions and 6 deletions

View File

@ -1076,14 +1076,17 @@ void SCH_PAINTER::draw( const LIB_TEXTBOX* aTextBox, int aLayer )
if( borderWidth > 0 ) if( borderWidth > 0 )
{ {
if( !m_schSettings.m_OverrideItemColors && !aTextBox->IsBrightened() COLOR4D borderColor = aTextBox->GetStroke().GetColor();
&& aTextBox->GetStroke().GetColor() != COLOR4D::UNSPECIFIED )
if( m_schSettings.m_OverrideItemColors || aTextBox->IsBrightened()
|| borderColor == COLOR4D::UNSPECIFIED )
{ {
m_gal->SetStrokeColor( aTextBox->GetStroke().GetColor() ); borderColor = m_schSettings.GetLayerColor( aLayer );
} }
m_gal->SetIsFill( false ); m_gal->SetIsFill( false );
m_gal->SetIsStroke( true ); m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( borderColor );
m_gal->SetLineWidth( borderWidth ); m_gal->SetLineWidth( borderWidth );
if( borderStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) if( borderStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows )
@ -2004,14 +2007,17 @@ void SCH_PAINTER::draw( const SCH_TEXTBOX* aTextBox, int aLayer )
if( borderWidth > 0 ) if( borderWidth > 0 )
{ {
if( !m_schSettings.m_OverrideItemColors && !aTextBox->IsBrightened() COLOR4D borderColor = aTextBox->GetStroke().GetColor();
&& aTextBox->GetStroke().GetColor() != COLOR4D::UNSPECIFIED )
if( m_schSettings.m_OverrideItemColors || aTextBox->IsBrightened()
|| borderColor == COLOR4D::UNSPECIFIED )
{ {
m_gal->SetStrokeColor( aTextBox->GetStroke().GetColor() ); borderColor = m_schSettings.GetLayerColor( aLayer );
} }
m_gal->SetIsFill( false ); m_gal->SetIsFill( false );
m_gal->SetIsStroke( true ); m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( borderColor );
m_gal->SetLineWidth( borderWidth ); m_gal->SetLineWidth( borderWidth );
if( borderStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows ) if( borderStyle <= PLOT_DASH_TYPE::FIRST_TYPE || drawingShadows )