Tighten isCoupledDiffPair test when we only have one item.

Improves https://gitlab.com/kicad/code/kicad/-/issues/19838
This commit is contained in:
Jeff Young
2025-06-26 19:42:14 -06:00
parent a37af2b81b
commit 2564e5511f
+9 -2
View File
@@ -1161,10 +1161,17 @@ static void isCoupledDiffPairFunc( LIBEVAL::CONTEXT* aCtx, void* self )
{
// DRC engine evaluates these only in the context of a diffpair, but doesn't
// always supply the second (B) item.
return 1.0;
if( BOARD* board = a->GetBoard() )
{
if( board->FindNet( coupledNet ) )
return 1.0;
}
}
return b && b->GetNetname() == coupledNet;
if( b && b->GetNetname() == coupledNet )
return 1.0;
return 0.0;
} );
}