From 524a43f95ec13e9d15ccf21a3516fc4b0f442d63 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 4 Oct 2022 13:21:24 +0100 Subject: [PATCH] Don't select footprints on the wrong side if not visible. Fixes https://gitlab.com/kicad/code/kicad/issues/12483 --- pcbnew/tools/pcb_selection_tool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index cea99f50e2..9bdd098d27 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2351,6 +2351,10 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili // Allow selection of footprints if some part of the footprint is visible. const FOOTPRINT* footprint = static_cast( aItem ); + LSET boardSide = footprint->IsFlipped() ? LSET::BackMask() : LSET::FrontMask(); + + if( !( visibleLayers() & boardSide ).any() && !m_skip_heuristics ) + return false; // If the footprint has no items except the reference and value fields, include the // footprint in the selections.