Use loaded colours for DNP symbol.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15203

(cherry picked from commit 89e2cb0b85)
This commit is contained in:
Jeff Young 2023-07-16 18:12:05 +01:00
parent 7c0a911e9f
commit c50888fc79
1 changed files with 5 additions and 6 deletions

View File

@ -2337,15 +2337,14 @@ 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->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 );