From 750b92b17f39100a2b642464d7d26e76ade5fe06 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 15 Aug 2023 17:06:42 +0100 Subject: [PATCH] Don't allow selection of footprint dimensions. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15418 --- pcbnew/tools/pcb_selection_tool.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index a54047c783..280662c320 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2690,6 +2690,23 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili break; + case PCB_DIM_ALIGNED_T: + case PCB_DIM_LEADER_T: + case PCB_DIM_CENTER_T: + case PCB_DIM_RADIAL_T: + case PCB_DIM_ORTHOGONAL_T: + if( aItem->GetParentFootprint() ) + { + // Footprint dimension selections are only allowed in footprint editor mode. + if( !checkVisibilityOnly ) + return false; + + if( !board()->IsLayerVisible( aItem->GetLayer() ) ) + return false; + } + + break; + case PCB_PAD_T: pad = static_cast( aItem );