Net inspector: Fix calculation of via length

We have a function for this in the BOARD_STACKUP now, and it returns
a more correct number (excluding the start and end copper layers)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8256
This commit is contained in:
Jon Evans 2021-04-20 20:03:26 -04:00
parent 2535daf661
commit 8792d7288d
1 changed files with 1 additions and 17 deletions

View File

@ -1373,23 +1373,7 @@ unsigned int DIALOG_NET_INSPECTOR::calculateViaLength( const TRACK* aTrack ) con
if( bds.m_HasStackup )
{
const BOARD_STACKUP& stackup = bds.GetStackupDescriptor();
std::pair<PCB_LAYER_ID, int> layer_dist[2] = { std::make_pair( via.TopLayer(), 0 ),
std::make_pair( via.BottomLayer(), 0 ) };
for( const BOARD_STACKUP_ITEM* i : stackup.GetList() )
{
for( std::pair<PCB_LAYER_ID, int>& j : layer_dist )
{
if( j.first != UNDEFINED_LAYER )
j.second += i->GetThickness();
if( j.first == i->GetBrdLayerId() )
j.first = UNDEFINED_LAYER;
}
}
return std::abs( layer_dist[0].second - layer_dist[1].second );
return stackup.GetLayerDistance( via.TopLayer(), via.BottomLayer() );
}
else
{