From a2fda9bd39d3b7da14f5f4417404f4f7bac367fe Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 7 May 2017 10:09:03 +1000 Subject: [PATCH] Fixed selection filtering - Fixed "double selection" of pads and pad parents in PCBNEW - Disabled selection of entire module in MODEDIT --- pcbnew/tools/selection_tool.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index a77e53e418..ec4e980a47 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -166,7 +166,8 @@ public: SELECTION_TOOL::SELECTION_TOOL() : PCB_TOOL( "pcbnew.InteractiveSelection" ), - m_frame( NULL ), m_additive( false ), m_multiple( false ), + m_frame( NULL ), m_additive( false ), m_subtractive( false ), + m_multiple( false ), m_locked( true ), m_menu( *this ), m_priv( std::make_unique() ) { @@ -526,6 +527,9 @@ bool SELECTION_TOOL::selectMultiple() { BOARD_ITEM* item = static_cast( it->first ); + if( !item || !selectable( item ) ) + continue; + /* Selection mode depends on direction of drag-selection: * Left > Right : Select objects that are fully enclosed by selection * Right > Left : Select objects that are crossed by selection @@ -1329,6 +1333,14 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const break; case PCB_MODULE_T: + + // In the module editor, we do not want to select the module itself + // rather, the module sub-components should be selected individually + if( m_editModules ) + { + return false; + } + if( aItem->IsOnLayer( F_Cu ) && board()->IsElementVisible( LAYER_MOD_FR ) ) return !m_editModules;