Fix hard-coded limit to dp choice

Fixes https://gitlab.com/kicad/code/kicad/issues/9459
This commit is contained in:
Seth Hillbrand 2021-10-25 10:45:06 -07:00
parent 4b5c010e63
commit 7812dc1a67
1 changed files with 6 additions and 1 deletions

View File

@ -983,7 +983,12 @@ int BOARD_DESIGN_SETTINGS::GetCurrentTrackWidth() const
void BOARD_DESIGN_SETTINGS::SetDiffPairIndex( unsigned aIndex ) void BOARD_DESIGN_SETTINGS::SetDiffPairIndex( unsigned aIndex )
{ {
m_diffPairIndex = std::min( aIndex, (unsigned) 8 ); if( !m_DiffPairDimensionsList.empty() )
{
m_diffPairIndex = std::min( aIndex,
static_cast<unsigned>( m_DiffPairDimensionsList.size() ) - 1 );
}
m_useCustomDiffPair = false; m_useCustomDiffPair = false;
} }