Replace some accidentally deleted code.

Fixes: lp:1804526
* https://bugs.launchpad.net/kicad/+bug/1804526
This commit is contained in:
Jeff Young 2018-11-22 01:09:40 +00:00
parent 964d6ebc06
commit 82f657ed03
1 changed files with 8 additions and 2 deletions

View File

@ -559,7 +559,13 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
int idx = eventId - ID_POPUP_GRID_LEVEL_1000;
SetPresetGrid( idx );
// Notify GAL
TOOL_MANAGER* mgr = GetToolManager();
if( mgr && IsGalCanvasActive() )
mgr->RunAction( "common.Control.gridPreset", true, idx );
else
SetPresetGrid( idx );
m_canvas->Refresh();
}
@ -743,7 +749,7 @@ void EDA_DRAW_FRAME::SetPresetGrid( int aIndex )
if( m_gridSelectBox )
{
if( glistIdx < 0 || glistIdx >= (int) m_gridSelectBox->GetCount() )
if( glistIdx < 0 || glistIdx >= (int) m_gridSelectBox->GetCount() - 2 )
{
wxASSERT_MSG( false, "Invalid grid index" );
return;