diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 04ce09f9f0..f6d0da6634 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1577,10 +1577,7 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const } // For vias it is enough if only one of its layers is visible - PCB_LAYER_ID top, bottom; - via->LayerPair( &top, &bottom ); - - return board()->IsLayerVisible( top ) || board()->IsLayerVisible( bottom ); + return ( board()->GetVisibleLayers() & via->GetLayerSet() ).any(); } break;