Fix index calculation in grid submenu
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15514
This commit is contained in:
parent
208d146a03
commit
375c2db844
|
@ -68,7 +68,7 @@ void GRID_MENU::UpdateTitle()
|
|||
void GRID_MENU::update()
|
||||
{
|
||||
APP_SETTINGS_BASE* settings = m_parent->config();
|
||||
unsigned int current = settings->m_Window.grid.last_size_idx;
|
||||
unsigned int current = settings->m_Window.grid.last_size_idx + ID_POPUP_GRID_START;
|
||||
wxArrayString gridsList;
|
||||
int i = ID_POPUP_GRID_START;
|
||||
|
||||
|
@ -78,7 +78,10 @@ void GRID_MENU::update()
|
|||
Delete( FindItemByPosition( 0 ) );
|
||||
|
||||
for( const wxString& grid : gridsList )
|
||||
Append( i++, grid, wxEmptyString, wxITEM_CHECK )->Check( i == (int) current );
|
||||
{
|
||||
int idx = i++;
|
||||
Append( idx, grid, wxEmptyString, wxITEM_CHECK )->Check( idx == (int) current );
|
||||
}
|
||||
}
|
||||
|
||||
void GRID_MENU::BuildChoiceList( wxArrayString* aGridsList, APP_SETTINGS_BASE* aCfg,
|
||||
|
|
Loading…
Reference in New Issue