From 686311f0b40b8e7d3281d0de34287f17bc7442e1 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 3 Sep 2020 18:05:20 -0400 Subject: [PATCH] Make sure to show newly-enabled layers when changing board setup Fixes https://gitlab.com/kicad/code/kicad/-/issues/5478 --- pcbnew/pcb_edit_frame.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 71e70e2179..e3804097e5 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1187,6 +1187,12 @@ void PCB_EDIT_FRAME::UpdateUserInterface() for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq ) layerEnum.Map( *seq, GetBoard()->GetLayerName( *seq ) ); + // Sync visibility with canvas + KIGFX::VIEW* view = GetCanvas()->GetView(); + + for( PCB_LAYER_ID layer : GetBoard()->GetVisibleLayers().Seq() ) + view->SetLayerVisible( layer, true ); + // Stackup and/or color theme may have changed m_appearancePanel->OnBoardChanged(); }