DRC: Fix a incorrect message and marker position when testing dangling vias.

Commit 6ffb721 detects vias connected on only one layer.
But the DRC diag (marker position and error message) were not correctly initialized
for this new test.
This commit is contained in:
jean-pierre charras 2021-01-10 10:21:24 +01:00
parent a718416245
commit 067b94c410
2 changed files with 9 additions and 1 deletions

View File

@ -619,7 +619,12 @@ bool CONNECTIVITY_DATA::TestTrackEndpointDangling( TRACK* aTrack, wxPoint* aPos
// This is a bit redundant but better safe than sorry here
if( connected.empty() )
{
if( aPos )
*aPos = aTrack->GetPosition();
return true;
}
// Here, we check if the via is connected only to items on a single layer
int first_layer = connected.front()->Layer();
@ -630,6 +635,9 @@ bool CONNECTIVITY_DATA::TestTrackEndpointDangling( TRACK* aTrack, wxPoint* aPos
return false;
}
if( aPos )
*aPos = aTrack->GetPosition();
return true;
}

View File

@ -78,7 +78,7 @@ DRC_ITEM DRC_ITEM::zoneHasEmptyNet( DRCE_ZONE_HAS_EMPTY_NET,
wxT( "zone_has_empty_net" ) );
DRC_ITEM DRC_ITEM::viaDangling( DRCE_DANGLING_VIA,
_( "Via is not connected" ),
_( "Via is not connected or connected on only one layer" ),
wxT( "via_dangling" ) );
DRC_ITEM DRC_ITEM::trackDangling( DRCE_DANGLING_TRACK,