From 4904ece0b5dd391f226cfe16c37c994848cf15fe Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 11 Oct 2018 18:44:59 +0200 Subject: [PATCH] eeschema gal: keep grid visibility setting when switching between back-ends --- eeschema/sch_base_frame.cpp | 2 -- eeschema/sch_draw_panel.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index d897c2589c..2646711f4c 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -91,9 +91,7 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, EDA_DRAW_FRAME( aKiway, aParent, aWindowType, aTitle, aPosition, aSize, aStyle, aFrameName ) { - printf("calling createCanvas\n"); createCanvas(); - printf("Canvas %p\n", m_canvas); m_zoomLevelCoeff = 11.0; // Adjusted to roughly displays zoom level = 1 // when the screen shows a 1:1 image diff --git a/eeschema/sch_draw_panel.cpp b/eeschema/sch_draw_panel.cpp index cd35047e6d..5943092074 100644 --- a/eeschema/sch_draw_panel.cpp +++ b/eeschema/sch_draw_panel.cpp @@ -197,7 +197,16 @@ bool SCH_DRAW_PANEL::SwitchBackend( GAL_TYPE aGalType ) bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType ); setDefaultLayerDeps(); m_gal->SetWorldUnitLength( IU_2_GAL_WORLD_UNIT ); + + // Keep grid size and grid visibility: m_gal->SetGridSize( grid_size ); + SCH_BASE_FRAME* frame = dynamic_cast( GetParent() ); + + if( frame ) + m_gal->SetGridVisibility( frame->IsGridVisible() ); + + Refresh(); + return rv; }