From a13f6c39224f66efb59a5cd1140b4710d1299616 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 19 Aug 2020 20:11:10 +0100 Subject: [PATCH] Repair initialization order in FOOTPRINT_VIEWER_FRAME. Fixes https://gitlab.com/kicad/code/kicad/issues/5267 --- pcbnew/footprint_viewer_frame.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 409a97d65d..369cc15c3b 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -169,6 +169,12 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent fpPanel->SetSizer( fpSizer ); fpPanel->Fit(); + // Create GAL canvas + m_canvasType = LoadCanvasTypeSetting(); + auto drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, + GetGalDisplayOptions(), m_canvasType ); + SetCanvas( drawPanel ); + SetBoard( new 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 @@ -187,12 +193,6 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent LoadSettings( config() ); GetGalDisplayOptions().m_axesEnabled = true; - // Create GAL canvas - m_canvasType = LoadCanvasTypeSetting(); - auto drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize, - GetGalDisplayOptions(), m_canvasType ); - SetCanvas( drawPanel ); - // Create the manager and dispatcher & route draw panel events to the dispatcher m_toolManager = new TOOL_MANAGER; m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),