Be smarter about determining if there are modules in the selection list.
The old algorithm would delete modules if another module was in the list, which was not the intention. Fixes https://gitlab.com/kicad/code/kicad/issues/4175
This commit is contained in:
parent
317e98b344
commit
e016b629d3
|
@ -2119,6 +2119,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 )
|
if( aCollector.CountType( PCB_MODULE_T ) > 0 )
|
||||||
{
|
{
|
||||||
double maxArea = calcMaxArea( aCollector, PCB_MODULE_T );
|
double maxArea = calcMaxArea( aCollector, PCB_MODULE_T );
|
||||||
|
@ -2148,7 +2159,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector,
|
||||||
continue;
|
continue;
|
||||||
// reject ALL OTHER footprints if there's still something else left
|
// reject ALL OTHER footprints if there's still something else left
|
||||||
// to select
|
// to select
|
||||||
else if( (int)( rejected.size() + 1 ) < aCollector.GetCount() )
|
else if( hasNonModules )
|
||||||
rejected.insert( mod );
|
rejected.insert( mod );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue