From b42fce430dedf3e680724761a0a00ad097bd48e4 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 28 Oct 2021 22:15:57 +0100 Subject: [PATCH] Separate default grid between eeschema/symeditor and other apps. Fixes https://gitlab.com/kicad/code/kicad/issues/9472 --- common/settings/app_settings.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index 7c7cf587c2..63eb047503 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -296,16 +296,21 @@ void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std: m_params.emplace_back( new PARAM_LIST( aJsonPath + ".grid.sizes", &aWindow->grid.sizes, DefaultGridSizeList() ) ); - // pcbnew default grid doesn't matter much, but eeschema does, so default to the index - // of the 50mil grid in eeschema + int defaultGridIdx; + + if( m_filename == "eeschema" || m_filename == "symbol_editor" ) + defaultGridIdx = 1; + else + defaultGridIdx = 4; + m_params.emplace_back( new PARAM( aJsonPath + ".grid.last_size", - &aWindow->grid.last_size_idx, 1 ) ); + &aWindow->grid.last_size_idx, defaultGridIdx ) ); m_params.emplace_back( new PARAM( aJsonPath + ".grid.fast_grid_1", - &aWindow->grid.fast_grid_1, 1 ) ); + &aWindow->grid.fast_grid_1, defaultGridIdx ) ); m_params.emplace_back( new PARAM( aJsonPath + ".grid.fast_grid_2", - &aWindow->grid.fast_grid_2, 2 ) ); + &aWindow->grid.fast_grid_2, defaultGridIdx + 1 ) ); // for grid user, use a default value compatible with eeschema and pcbnew (10 mils) m_params.emplace_back( new PARAM( aJsonPath + ".grid.user_grid_x",