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 )
SetUserUnits( caller->GetUserUnits() );
PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions();
// 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
// The footprint or pad specific clearance will be shown
GetBoard()->GetDesignSettings().GetDefault()->SetClearance( 0 );
disp_opts.m_DisplayPadIsol = true;
disp_opts.m_DisplayPadNum = true;
SetDisplayOptions( disp_opts );
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );
// Create GAL canvas
@ -143,6 +137,12 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
GetGalDisplayOptions(), backend );
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
m_toolManager = new TOOL_MANAGER;
m_toolManager->SetEnvironment( GetBoard(), gal_drawPanel->GetView(),