From 18d9f6e323a372e2be3468668e1b8ae18411816b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 9 Nov 2021 11:59:25 +0000 Subject: [PATCH] Reduce auto. --- pcbnew/pcb_base_frame.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 46e2ca9628..d252280ae4 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -809,24 +809,23 @@ void PCB_BASE_FRAME::ActivateGalCanvas() EDA_DRAW_FRAME::ActivateGalCanvas(); EDA_DRAW_PANEL_GAL* canvas = GetCanvas(); + KIGFX::VIEW* view = canvas->GetView(); if( m_toolManager ) { - m_toolManager->SetEnvironment( m_pcb, GetCanvas()->GetView(), - GetCanvas()->GetViewControls(), config(), this ); + m_toolManager->SetEnvironment( m_pcb, view, canvas->GetViewControls(), config(), this ); + + m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH ); } - if( m_toolManager ) - m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH ); + KIGFX::PCB_PAINTER* painter = static_cast( view->GetPainter() ); + KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings(); + const PCB_DISPLAY_OPTIONS& displ_opts = GetDisplayOptions(); - // Transfer latest current display options from legacy to GAL canvas: - auto painter = static_cast( canvas->GetView()->GetPainter() ); - auto settings = painter->GetSettings(); - auto displ_opts = GetDisplayOptions(); settings->LoadDisplayOptions( displ_opts, ShowPageLimits() ); settings->LoadColors( GetColorSettings() ); - canvas->GetView()->RecacheAllItems(); + view->RecacheAllItems(); canvas->SetEventDispatcher( m_toolDispatcher ); canvas->StartDrawing(); }