From 3edcef0229315bda538451cfcee5c8c32e1dbb83 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 28 Aug 2023 07:27:25 -0400 Subject: [PATCH] Grids: remove more uses of old user grid in UI Fixes: https://gitlab.com/kicad/code/kicad/-/issues/15515 --- common/tool/common_tools.cpp | 7 ------- pcbnew/dialogs/dialog_board_reannotate.cpp | 16 +++------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index ddc7d34bd5..fd984b739e 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -69,13 +69,6 @@ void COMMON_TOOLS::Reset( RESET_REASON aReason ) m_grids.emplace_back( KiROUND( gridSize ), KiROUND( gridSize ) ); } - double userGridX = EDA_UNIT_UTILS::UI::DoubleValueFromString( scale, EDA_UNITS::MILLIMETRES, - settings.user_grid_x ); - double userGridY = EDA_UNIT_UTILS::UI::DoubleValueFromString( scale, EDA_UNITS::MILLIMETRES, - settings.user_grid_y ); - - m_grids.emplace_back( KiROUND( userGridX ), KiROUND( userGridY ) ); - OnGridChanged( false ); } diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 950717b5b5..be6a5c7cb7 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -403,19 +403,9 @@ void DIALOG_BOARD_REANNOTATE::GetParameters() // Get the chosen sort grid for rounding m_gridIndex = m_GridChoice->GetSelection(); - if( m_gridIndex >= ( int ) m_settings->m_Window.grid.sizes.size() ) - { - m_sortGridx = EDA_UNIT_UTILS::UI::DoubleValueFromString( - pcbIUScale, EDA_UNITS::MILS, m_settings->m_Window.grid.user_grid_x ); - m_sortGridy = EDA_UNIT_UTILS::UI::DoubleValueFromString( - pcbIUScale, EDA_UNITS::MILS, m_settings->m_Window.grid.user_grid_y ); - } - else - { - m_sortGridx = EDA_UNIT_UTILS::UI::DoubleValueFromString( - pcbIUScale, EDA_UNITS::MILS, m_settings->m_Window.grid.sizes[m_gridIndex] ); - m_sortGridy = m_sortGridx; - } + m_sortGridx = EDA_UNIT_UTILS::UI::DoubleValueFromString( + pcbIUScale, EDA_UNITS::MILS, m_settings->m_Window.grid.sizes[m_gridIndex] ); + m_sortGridy = m_sortGridx; m_annotationScope = ANNOTATE_ALL;