From 82f657ed036fd5fc3609c1baaf13f2449d77baaa Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 22 Nov 2018 01:09:40 +0000 Subject: [PATCH] Replace some accidentally deleted code. Fixes: lp:1804526 * https://bugs.launchpad.net/kicad/+bug/1804526 --- common/legacy_wx/eda_draw_frame.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/legacy_wx/eda_draw_frame.cpp b/common/legacy_wx/eda_draw_frame.cpp index 144f1c933f..0c4787f8d0 100644 --- a/common/legacy_wx/eda_draw_frame.cpp +++ b/common/legacy_wx/eda_draw_frame.cpp @@ -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;