Use loaded colours for DNP symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15203
This commit is contained in:
Jeff Young 2023-07-16 18:12:05 +01:00
parent c2e7827774
commit 89e2cb0b85
1 changed files with 5 additions and 6 deletions

View File

@ -2491,17 +2491,16 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer )
if( aSymbol->GetDNP() ) if( aSymbol->GetDNP() )
{ {
COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); BOX2I bbox = aSymbol->GetBodyAndPinsBoundingBox();
BOX2I bbox = aSymbol->GetBodyAndPinsBoundingBox(); VECTOR2I pt1 = bbox.GetOrigin();
VECTOR2I pt1 = bbox.GetOrigin(); VECTOR2I pt2 = bbox.GetEnd();
VECTOR2I pt2 = bbox.GetEnd();
m_gal->PushDepth(); m_gal->PushDepth();
m_gal->AdvanceDepth(); m_gal->AdvanceDepth();
m_gal->SetIsStroke( true ); m_gal->SetIsStroke( true );
m_gal->SetIsFill( true ); m_gal->SetIsFill( true );
m_gal->SetStrokeColor( colors->GetColor( LAYER_ERC_ERR ) ); m_gal->SetStrokeColor( m_schSettings.GetLayerColor( LAYER_ERC_ERR ) );
m_gal->SetFillColor( colors->GetColor( LAYER_ERC_ERR ) ); m_gal->SetFillColor( m_schSettings.GetLayerColor( LAYER_ERC_ERR ) );
m_gal->DrawSegment( pt1, pt2, 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ); m_gal->DrawSegment( pt1, pt2, 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) );
std::swap( pt1.x, pt2.x ); std::swap( pt1.x, pt2.x );