diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index d4274685d0..011aab2b82 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -32,7 +32,7 @@ #include #include #include -//#include +#include #include #include #include @@ -40,7 +40,6 @@ #include #include #include -//#include #include #include #include @@ -959,6 +958,13 @@ void PCB_EDIT_FRAME::UpdateUserInterface() // Update info shown by the horizontal toolbars ReCreateLayerBox(); + LSET activeLayers = GetBoard()->GetEnabledLayers(); + + if( !activeLayers.test( GetActiveLayer() ) ) + SetActiveLayer( activeLayers.Seq().front() ); + + m_SelLayerBox->SetLayerSelection( GetActiveLayer() ); + // Update the layer manager m_Layers->Freeze(); ReFillLayerWidget();