← Back to team overview

kicad-developers team mailing list archive

[PATCH] add helper to selecting graphic grid. Add 40 mils grid (approx. 1mm) to draw graphic items in mm

 

Hello.
Can you apply my small patch? Description of the patch in mail theme.
>From 76d8d7e42f66d06a2bd0168cc1b28bdaa6dbbd7a Mon Sep 17 00:00:00 2001
From: Eldar Khayrullin <eldar.khayrullin@xxxxxxx>
Date: Sat, 18 Nov 2017 14:41:32 +0300
Subject: [PATCH] eeschema: add a 40 mils grid convenient to draw graphic in
 mm. Add a helper for selecting grid

---
 common/zoom.cpp         | 7 +++++++
 eeschema/sch_screen.cpp | 1 +
 include/id.h            | 1 +
 3 files changed, 9 insertions(+)

diff --git a/common/zoom.cpp b/common/zoom.cpp
index 216a4ad92..76a84f664 100644
--- a/common/zoom.cpp
+++ b/common/zoom.cpp
@@ -291,6 +291,13 @@ void EDA_DRAW_FRAME::AddMenuZoomAndGrid( wxMenu* MasterMenu )
             GRID_TYPE& grid = screen->GetGrid( i );
             gridMenu->Append( grid.m_CmdId, gridsList[i], wxEmptyString, wxITEM_CHECK );
 
+            if( grid.m_CmdId == ID_POPUP_GRID_LEVEL_50 )
+            {
+                gridMenu->AppendSeparator();
+                gridMenu->Append( wxID_ANY, _( "Graphic item grids:" ) );
+                gridMenu->AppendSeparator();
+            }
+
             if( (int)i == icurr )
                 gridMenu->Check( grid.m_CmdId, true );
         }
diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp
index 2fd507133..56d39f441 100644
--- a/eeschema/sch_screen.cpp
+++ b/eeschema/sch_screen.cpp
@@ -82,6 +82,7 @@ static double SchematicZoomList[] =
 static GRID_TYPE SchematicGridList[] = {
     { ID_POPUP_GRID_LEVEL_100, wxRealPoint( 100, 100 ) },
     { ID_POPUP_GRID_LEVEL_50, wxRealPoint( 50, 50 ) },
+    { ID_POPUP_GRID_LEVEL_40, wxRealPoint( 40, 40 ) },
     { ID_POPUP_GRID_LEVEL_25, wxRealPoint( 25, 25 ) },
     { ID_POPUP_GRID_LEVEL_10, wxRealPoint( 10, 10 ) },
     { ID_POPUP_GRID_LEVEL_5, wxRealPoint( 5, 5 ) },
diff --git a/include/id.h b/include/id.h
index 64411163b..b4acf8386 100644
--- a/include/id.h
+++ b/include/id.h
@@ -207,6 +207,7 @@ enum main_id
     ID_POPUP_GRID_LEVEL_200,
     ID_POPUP_GRID_LEVEL_100,
     ID_POPUP_GRID_LEVEL_50,
+    ID_POPUP_GRID_LEVEL_40,
     ID_POPUP_GRID_LEVEL_25,
     ID_POPUP_GRID_LEVEL_20,
     ID_POPUP_GRID_LEVEL_10,
-- 
2.14.1


Follow ups