pcbnew: Fix footprint selection when only opposite-side layers visible

Footprints with graphics on both copper layers (like fiducials without
pads) were not selectable when only the opposite-side layers were
visible. For example, a footprint declared on F.Cu with graphics on
B.Cu could not be selected when showing only bottom layers.

The early-return check based on the footprint's declared side prevented
the child visibility iteration from running, even though child items on
the opposite layer were visible. Removing this check allows the existing
child iteration to correctly determine selectability based on whether
any child items are on visible layers.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22666

(cherry picked from commit 40ea18277f)
This commit is contained in:
Seth Hillbrand
2026-02-05 23:01:37 -08:00
parent bd64ea015c
commit 0ae20bf3b0
-9
View File
@@ -2910,15 +2910,6 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili
if( m_isFootprintEditor )
return false;
// Allow selection of footprints if some part of the footprint is visible.
if( footprint->GetSide() != UNDEFINED_LAYER && !m_skip_heuristics )
{
LSET boardSide = footprint->IsFlipped() ? LSET::BackMask() : LSET::FrontMask();
if( !( visibleLayers() & boardSide ).any() )
return false;
}
// If the footprint has no items except the reference and value fields, include the
// footprint in the selections.
if( footprint->GraphicalItems().empty()