From 25e181db5c489b4b42a142d6b37d09163704440a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 12 Mar 2024 21:29:55 +0000 Subject: [PATCH] Don't allow selection of footprint text in board editor. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17271 --- pcbnew/tools/pcb_selection_tool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 08b17e9745..57d02e9209 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2910,6 +2910,11 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili } else if( aItem->GetParentFootprint() ) { + // Footprint text selections are only allowed in footprint editor mode. + // Careful, though: we also get here through the PCB_FIELD_T case. + if( aItem->Type() == PCB_TEXT_T && !checkVisibilityOnly ) + return false; + if( !view()->IsVisible( text ) ) return false;