Only init display options after creating a canvas

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4909
This commit is contained in:
Jon Evans 2020-07-16 22:27:03 -04:00
parent 261614d469
commit 5444a1b4b0
1 changed files with 6 additions and 6 deletions

View File

@ -120,16 +120,10 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
if( caller ) if( caller )
SetUserUnits( caller->GetUserUnits() ); SetUserUnits( caller->GetUserUnits() );
PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions();
// In viewer, the default net clearance is not known (it depends on the actual board). // In viewer, the default net clearance is not known (it depends on the actual board).
// So we do not show the default clearance, by setting it to 0 // So we do not show the default clearance, by setting it to 0
// The footprint or pad specific clearance will be shown // The footprint or pad specific clearance will be shown
GetBoard()->GetDesignSettings().GetDefault()->SetClearance( 0 ); GetBoard()->GetDesignSettings().GetDefault()->SetClearance( 0 );
disp_opts.m_DisplayPadIsol = true;
disp_opts.m_DisplayPadNum = true;
SetDisplayOptions( disp_opts );
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false ); GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );
// Create GAL canvas // Create GAL canvas
@ -143,6 +137,12 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
GetGalDisplayOptions(), backend ); GetGalDisplayOptions(), backend );
SetCanvas( gal_drawPanel ); SetCanvas( gal_drawPanel );
PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions();
disp_opts.m_DisplayPadIsol = true;
disp_opts.m_DisplayPadNum = true;
SetDisplayOptions( disp_opts );
// Create the manager and dispatcher & route draw panel events to the dispatcher // Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager = new TOOL_MANAGER; m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(), m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),