GerbView: properly load worksheet visibility at startup

(cherry picked from commit 5d1dcb4387)
This commit is contained in:
Jon Evans 2019-05-25 16:58:10 -04:00
parent e156e4509c
commit 6b40473f5d
1 changed files with 4 additions and 2 deletions

View File

@ -353,7 +353,9 @@ void GERBVIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
// was: wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() );
wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
aCfg->Read( cfgShowBorderAndTitleBlock, &m_showBorderAndTitleBlock, false );
bool tmp;
aCfg->Read( cfgShowBorderAndTitleBlock, &tmp, false );
SetElementVisibility( LAYER_WORKSHEET, tmp );
PAGE_INFO pageInfo( wxT( "GERBER" ) );
wxString pageType;
@ -362,7 +364,6 @@ void GERBVIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
pageInfo.SetType( pageType );
SetPageSettings( pageInfo );
bool tmp;
aCfg->Read( cfgShowDCodes, &tmp, true );
SetElementVisibility( LAYER_DCODES, tmp );
aCfg->Read( cfgShowNegativeObjects, &tmp, false );
@ -471,6 +472,7 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
case LAYER_WORKSHEET:
m_showBorderAndTitleBlock = aNewState;
GetGalCanvas()->GetView()->SetLayerVisible( LAYER_WORKSHEET, aNewState );
break;
case LAYER_GERBVIEW_GRID: