eeschema gal: keep grid visibility setting when switching between back-ends

This commit is contained in:
jean-pierre charras 2018-10-11 18:44:59 +02:00
parent 4d8534a7a6
commit 4904ece0b5
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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<SCH_BASE_FRAME*>( GetParent() );
if( frame )
m_gal->SetGridVisibility( frame->IsGridVisible() );
Refresh();
return rv;
}