From f4a8275f3e010f813704882e85fab0f7a9b9e6e8 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Fri, 25 Sep 2020 21:15:32 -0400 Subject: [PATCH] Allow selecting pads of locked footprints when filter allows Before the selection filter, this heuristic made sense, but now there is an explicit toggle to disable selection of locked items, so we want to be able to select pads when that toggle is enabled. --- pcbnew/tools/selection_tool.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 7208560ab6..807f403a4e 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1491,10 +1491,18 @@ bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) break; case PCB_PAD_T: + { if( !m_filter.pads ) return false; + // Parent footprint locking should apply to pads also + D_PAD* pad = static_cast( aItem ); + + if( !m_filter.lockedItems && pad->GetParent() && pad->GetParent()->IsLocked() ) + return false; + break; + } case PCB_TRACE_T: case PCB_ARC_T: @@ -1918,14 +1926,6 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn { auto pad = static_cast( aItem ); - // In pcbnew, locked modules prevent individual pad selection. - // In modedit, we don't enforce this as the module is assumed to be edited by design. - if( !m_editModules && !checkVisibilityOnly ) - { - if( pad->GetParent() && pad->GetParent()->IsLocked() ) - return false; - } - // Check render mode (from the Items tab) first switch( pad->GetAttribute() ) {