From 69e20c73adda88a19733196be07fc851e6ca6710 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Mon, 11 Nov 2019 22:55:06 +0000 Subject: [PATCH] fpeditor: Fix initial grid display setting The footprint editor didn't respect the display setting showing/hiding the grid on startup. Fixes: lp:1843169 * https://bugs.launchpad.net/kicad/+bug/1843169 --- pcbnew/footprint_edit_frame.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 45c6208317..2703e5eece 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -214,8 +214,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); - GetCanvas()->GetGAL()->SetAxesEnabled( true ); - GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) ); GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() ); ActivateGalCanvas(); @@ -814,8 +812,13 @@ void FOOTPRINT_EDIT_FRAME::ActivateGalCanvas() { PCB_BASE_EDIT_FRAME::ActivateGalCanvas(); - // Be sure the axis are enabled: + // Be sure the axis are enabled GetCanvas()->GetGAL()->SetAxesEnabled( true ); + + // Setup the grid + GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) ); + GetCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() ); + updateView(); // Ensure the m_Layers settings are using the canvas type: