diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index d03fce8f69..1a36540b4f 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -2146,6 +2146,17 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector, } } + bool hasNonModules = false; + + for( int i = 0; i < aCollector.GetCount(); ++i ) + { + if( aCollector[i]->Type() != PCB_MODULE_T ) + { + hasNonModules = true; + break; + } + } + if( aCollector.CountType( PCB_MODULE_T ) > 0 ) { double maxArea = calcMaxArea( aCollector, PCB_MODULE_T ); @@ -2175,7 +2186,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector, continue; // reject ALL OTHER footprints if there's still something else left // to select - else if( (int)( rejected.size() + 1 ) < aCollector.GetCount() ) + else if( hasNonModules ) rejected.insert( mod ); } }