PNS: Ensure we don't miss items

Higher candidate levels could override better matches if the layers did
not overlap.
This commit is contained in:
Seth Hillbrand 2018-10-20 07:57:54 -07:00
parent f183b4f526
commit 3cc87b4597
1 changed files with 1 additions and 4 deletions

View File

@ -189,16 +189,13 @@ ITEM* TOOL_BASE::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLayer, b
if( item && !item->Layers().Overlaps( tl ) )
item = NULL;
if( item )
if( item && ( aLayer < 0 || item->Layers().Overlaps( aLayer ) ) )
{
rv = item;
break;
}
}
if( rv && aLayer >= 0 && !rv->Layers().Overlaps( aLayer ) )
rv = NULL;
if( rv )
{
wxLogTrace( "PNS", "%s, layer : %d, tl: %d", rv->KindStr().c_str(), rv->Layers().Start(), tl );