diff --git a/common/dialogs/dialog_grid_settings.cpp b/common/dialogs/dialog_grid_settings.cpp index 8341568d20..7e528e19e2 100644 --- a/common/dialogs/dialog_grid_settings.cpp +++ b/common/dialogs/dialog_grid_settings.cpp @@ -29,7 +29,7 @@ #include #include #include - +#include DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS( EDA_DRAW_FRAME* aParent ): DIALOG_GRID_SETTINGS_BASE( aParent ), @@ -87,8 +87,11 @@ bool DIALOG_GRID_SETTINGS::TransferDataFromWindow() gridCfg.fast_grid_1 = m_grid1Ctrl->GetSelection(); gridCfg.fast_grid_2 = m_grid2Ctrl->GetSelection(); - // Notify GAL + // Notify TOOLS TOOL_MANAGER* mgr = m_parent->GetToolManager(); + mgr->ResetTools( TOOL_BASE::MODEL_RELOAD ); + + // Notify GAL mgr->RunAction( ACTIONS::gridPreset, true, gridCfg.last_size_idx ); mgr->RunAction( ACTIONS::gridSetOrigin, true, new VECTOR2D( m_parent->GetGridOrigin() ) ); diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index f8cb4d62ff..9ba321ae92 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -45,14 +45,19 @@ void COMMON_TOOLS::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); + GRID_SETTINGS& settings = m_toolMgr->GetSettings()->m_Window.grid; + m_grids.clear(); - for( const wxString& gridDef : m_toolMgr->GetSettings()->m_Window.grid.sizes ) + for( const wxString& gridDef : settings.sizes ) { int gridSize = (int) ValueFromString( EDA_UNITS::MILLIMETRES, gridDef, true ); m_grids.emplace_back( gridSize, gridSize ); } + m_grids.emplace_back( ValueFromString( EDA_UNITS::MILLIMETRES, settings.user_grid_x, true ), + ValueFromString( EDA_UNITS::MILLIMETRES, settings.user_grid_y, true ) ); + OnGridChanged(); } diff --git a/include/tool/common_tools.h b/include/tool/common_tools.h index 89a2bb62d0..688adbb3af 100644 --- a/include/tool/common_tools.h +++ b/include/tool/common_tools.h @@ -100,6 +100,7 @@ private: int doZoomToPreset( int idx, bool aCenterOnCursor ); std::vector m_grids; // grids from APP_SETTINGS converted to internal units + // and with the user grid appended }; #endif diff --git a/pcbnew/dialogs/panel_setup_netclasses.cpp b/pcbnew/dialogs/panel_setup_netclasses.cpp index bc0b94f193..10fa75a87f 100644 --- a/pcbnew/dialogs/panel_setup_netclasses.cpp +++ b/pcbnew/dialogs/panel_setup_netclasses.cpp @@ -279,8 +279,8 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow() m_Pcb->SynchronizeNetsAndNetClasses(); m_BrdSettings->SetCurrentNetClass( NETCLASS::Default ); - if( auto toolmgr = m_Frame->GetToolManager() ) - toolmgr->ResetTools( TOOL_BASE::MODEL_RELOAD ); + if( m_Frame->GetToolManager() ) + m_Frame->GetToolManager()->ResetTools( TOOL_BASE::MODEL_RELOAD ); return true; }