From d02c0da3ab1c798a155d6e64041100458ab5560c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 3 Feb 2020 15:44:41 +0000 Subject: [PATCH] Remove preferred layer disambiguation for multiple modules. The preferred list isn't actually in use anymore at this point, so it currently has no effect other than to mess things up since we aren't keeping track of which modules have been rejected when we check the module count. Fixes https://gitlab.com/kicad/code/kicad/issues/3721 --- pcbnew/tools/selection_tool.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 19bbd35c6c..0f2cd06c3c 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1973,10 +1973,8 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, } } - int numZones = aCollector.CountType( PCB_ZONE_AREA_T ); - // Zone edges are very specific; zone fills much less so. - if( numZones > 0 ) + if( aCollector.CountType( PCB_ZONE_AREA_T ) > 0 ) { for( int i = aCollector.GetCount() - 1; i >= 0; i-- ) { @@ -2102,9 +2100,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, } } - int moduleCount = aCollector.CountType( PCB_MODULE_T ); - - if( moduleCount > 0 ) + if( aCollector.CountType( PCB_MODULE_T ) > 0 ) { double maxArea = calcMaxArea( aCollector, PCB_MODULE_T ); BOX2D viewportD = getView()->GetViewport(); @@ -2131,10 +2127,6 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, // footprint then it should be considered for selection else if( calcRatio( calcArea( mod ), maxArea ) <= footprintToFootprintMinRatio ) continue; - // if there are multiple footprints for selection at this point, prefer - // one that is on the active layer - else if( moduleCount > 1 && mod->GetLayer() == activeLayer ) - preferred.insert( mod ); // reject ALL OTHER footprints if there's still something else left // to select else if( (int)( rejected.size() + 1 ) < aCollector.GetCount() )