From 4ff61318af0534773428f3e674eca679a51d250f Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 5 Apr 2020 18:48:45 +0100 Subject: [PATCH] Push pcbnew grid visibility storage into EDA_DRAW_FRAME Fixes https://gitlab.com/kicad/code/kicad/issues/4154 --- include/pcb_display_options.h | 1 - pcbnew/pcb_base_frame.cpp | 4 ++-- pcbnew/pcb_display_options.cpp | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/pcb_display_options.h b/include/pcb_display_options.h index 38baaca164..7a5c36ef61 100644 --- a/include/pcb_display_options.h +++ b/include/pcb_display_options.h @@ -84,7 +84,6 @@ public: int m_MaxLinksShowed; // in track creation: number of hairwires shown bool m_ShowModuleRatsnest; // When moving a footprint: allows displaying a ratsnest bool m_ShowGlobalRatsnest; // If true, show all - bool m_ShowGrid; // Show the grid on the canvas bool m_DisplayRatsnestLinesCurved; // Airwires can be drawn as straight lines (false) // or curved lines (true) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 09ead0b520..9de504eb9b 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -870,13 +870,13 @@ void PCB_BASE_FRAME::SetFastGrid2() bool PCB_BASE_FRAME::IsGridVisible() const { - return m_DisplayOptions.m_ShowGrid; + return m_drawGrid; } void PCB_BASE_FRAME::SetGridVisibility( bool aVisible ) { - m_DisplayOptions.m_ShowGrid = aVisible; + m_drawGrid = aVisible; // Update the display with the new grid if( GetCanvas() ) diff --git a/pcbnew/pcb_display_options.cpp b/pcbnew/pcb_display_options.cpp index 784c8b38c7..5a8a82d0fe 100644 --- a/pcbnew/pcb_display_options.cpp +++ b/pcbnew/pcb_display_options.cpp @@ -56,5 +56,4 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS() m_ShowModuleRatsnest = true; // When moving a footprint: allows displaying a ratsnest m_DisplayRatsnestLinesCurved = false; m_ShowGlobalRatsnest = true; - m_ShowGrid = true; }