diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 38f5b72439..2460ed1f74 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1531,11 +1531,8 @@ void PCB_EDIT_FRAME::UpdateUserInterface() } // Sync visibility with canvas - KIGFX::VIEW* view = GetCanvas()->GetView(); - LSET visible = GetBoard()->GetVisibleLayers(); - for( PCB_LAYER_ID layer : LSET::AllLayersMask().Seq() ) - view->SetLayerVisible( layer, visible.Contains( layer ) ); + GetCanvas()->GetView()->SetLayerVisible( layer, GetBoard()->IsLayerVisible( layer ) ); // Stackup and/or color theme may have changed m_appearancePanel->OnBoardChanged();