diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 18a222ea2a..169a6ffcf4 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -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 );