diff --git a/include/board_design_settings.h b/include/board_design_settings.h index 171775db06..8ca74f6d72 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -304,12 +304,12 @@ public: /** * @return the biggest clearance value found in NetClasses list. */ - int GetBiggestClearanceValue(); + int GetBiggestClearanceValue() const; /** * @return the smallest clearance value found in NetClasses list. */ - int GetSmallestClearanceValue(); + int GetSmallestClearanceValue() const; /** * @return the current micro via size that is the current netclass value. @@ -547,8 +547,10 @@ public: { if( m_useCustomDiffPair ) return m_customDiffPair.m_Width; - else + else if( m_diffPairIndex < m_DiffPairDimensionsList.size() ) return m_DiffPairDimensionsList[m_diffPairIndex].m_Width; + else + return GetCurrentTrackWidth(); } /** @@ -560,8 +562,10 @@ public: { if( m_useCustomDiffPair ) return m_customDiffPair.m_Gap; - else + else if( m_diffPairIndex < m_DiffPairDimensionsList.size() ) return m_DiffPairDimensionsList[m_diffPairIndex].m_Gap; + else + return GetSmallestClearanceValue(); } /** @@ -573,8 +577,10 @@ public: { if( m_useCustomDiffPair ) return m_customDiffPair.m_ViaGap; - else + else if( m_diffPairIndex < m_DiffPairDimensionsList.size() ) return m_DiffPairDimensionsList[m_diffPairIndex].m_ViaGap; + else + return GetSmallestClearanceValue(); } /** diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 907c90ff99..2265db8fab 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -868,7 +868,7 @@ bool BOARD_DESIGN_SETTINGS::Ignore( int aDRCErrorCode ) } -int BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue() +int BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue() const { int biggest = 0; DRC_CONSTRAINT constraint; @@ -889,7 +889,7 @@ int BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue() } -int BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue() +int BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue() const { int clearance = GetDefault()->GetClearance();