mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Force grids to have entries.
If they don't in the file, reset to the default Fixes https://gitlab.com/kicad/code/kicad/-/issues/21060
This commit is contained in:
parent
307f3c17bc
commit
e957d10098
@ -455,6 +455,10 @@ void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std:
|
|||||||
m_params.emplace_back( new PARAM_LIST<GRID>( aJsonPath + ".grid.sizes", &aWindow->grid.grids,
|
m_params.emplace_back( new PARAM_LIST<GRID>( aJsonPath + ".grid.sizes", &aWindow->grid.grids,
|
||||||
DefaultGridSizeList() ) );
|
DefaultGridSizeList() ) );
|
||||||
|
|
||||||
|
// Force grids to have at least 1 entry. If not, reset to default.
|
||||||
|
if( aWindow->grid.grids.empty() )
|
||||||
|
aWindow->grid.grids = DefaultGridSizeList();
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.last_size",
|
m_params.emplace_back( new PARAM<int>( aJsonPath + ".grid.last_size",
|
||||||
&aWindow->grid.last_size_idx, defaultGridIdx ) );
|
&aWindow->grid.last_size_idx, defaultGridIdx ) );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user