Ensure currentGrid is valid on startup
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4666
This commit is contained in:
parent
8c57821e9b
commit
0dd34d197e
|
@ -392,6 +392,8 @@ int COMMON_TOOLS::OnGridChanged()
|
|||
{
|
||||
int& currentGrid = m_toolMgr->GetSettings()->m_Window.grid.last_size_idx;
|
||||
|
||||
currentGrid = std::max( 0, std::min( currentGrid, static_cast<int>( m_grids.size() ) - 1 ) );
|
||||
|
||||
// Update the combobox (if any)
|
||||
wxUpdateUIEvent dummy;
|
||||
m_frame->OnUpdateSelectGrid( dummy );
|
||||
|
|
Loading…
Reference in New Issue