From 5d1dcb4387ba652d0a40979a270c317ac7ddd177 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 25 May 2019 16:58:10 -0400 Subject: [PATCH] GerbView: properly load worksheet visibility at startup --- gerbview/gerbview_frame.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index cf11984ca9..8973744cdc 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -350,7 +350,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; @@ -359,7 +361,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 ); @@ -468,6 +469,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: