Fix issue for stand alone python scripts, when running without project.

This commit is contained in:
jean-pierre charras 2022-02-14 18:57:58 +01:00
parent 6f2a7db369
commit a455dd8815
1 changed files with 4 additions and 1 deletions

View File

@ -127,7 +127,10 @@ void PCB_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings )
m_layerColors[GetNetnameLayer( layer )] = lightLabel; m_layerColors[GetNetnameLayer( layer )] = lightLabel;
} }
if( PgmOrNull() ) // can be null if used without project (i.e. from python script)
m_hiContrastFactor = 1.0f - Pgm().GetCommonSettings()->m_Appearance.hicontrast_dimming_factor; m_hiContrastFactor = 1.0f - Pgm().GetCommonSettings()->m_Appearance.hicontrast_dimming_factor;
else
m_hiContrastFactor = 1.0f - 0.8f; // default value
update(); update();
} }