Browse Source

We need to clamp the index to max - 1

What did we think this was?  Pascal?

Fixes https://gitlab.com/kicad/code/kicad/issues/21750

(cherry picked from commit 9c0727f28e)
9.0
Seth Hillbrand 3 weeks ago
parent
commit
c0648c4728
  1. 4
      pcbnew/board_design_settings.cpp

4
pcbnew/board_design_settings.cpp

@ -1326,7 +1326,7 @@ int BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue() const
void BOARD_DESIGN_SETTINGS::SetViaSizeIndex( unsigned aIndex )
{
m_viaSizeIndex = std::min( aIndex, (unsigned) m_ViasDimensionsList.size() );
m_viaSizeIndex = std::min<unsigned>( aIndex, m_ViasDimensionsList.size() - 1 );
m_useCustomTrackVia = false;
}
@ -1359,7 +1359,7 @@ int BOARD_DESIGN_SETTINGS::GetCurrentViaDrill() const
void BOARD_DESIGN_SETTINGS::SetTrackWidthIndex( unsigned aIndex )
{
m_trackWidthIndex = std::min( aIndex, (unsigned) m_TrackWidthList.size() );
m_trackWidthIndex = std::min<unsigned>( aIndex, m_TrackWidthList.size() - 1 );
m_useCustomTrackVia = false;
}

Loading…
Cancel
Save