Separate default grid between eeschema/symeditor and other apps.

Fixes https://gitlab.com/kicad/code/kicad/issues/9472
This commit is contained in:
Jeff Young 2021-10-28 22:15:57 +01:00
parent fe6cb7dbb4
commit b42fce430d
1 changed files with 10 additions and 5 deletions

View File

@ -296,16 +296,21 @@ void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std:
m_params.emplace_back( new PARAM_LIST<wxString>( 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<int>( aJsonPath + ".grid.last_size",
&aWindow->grid.last_size_idx, 1 ) );
&aWindow->grid.last_size_idx, defaultGridIdx ) );
m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.fast_grid_1",
&aWindow->grid.fast_grid_1, 1 ) );
&aWindow->grid.fast_grid_1, defaultGridIdx ) );
m_params.emplace_back( new PARAM<int>( 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<wxString>( aJsonPath + ".grid.user_grid_x",