diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 57b469ec59..452e78b1bb 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -103,6 +103,7 @@ static const wxChar EnableGit[] = wxT( "EnableGit" ); static const wxChar EnableEeschemaPrintCairo[] = wxT( "EnableEeschemaPrintCairo" ); static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" ); static const wxChar PcbSelectionVisibilityRatio[] = wxT( "PcbSelectionVisibilityRatio" ); +static const wxChar MinimumSegmentLength[] = wxT( "MinimumSegmentLength" ); } // namespace KEYS @@ -245,6 +246,8 @@ ADVANCED_CFG::ADVANCED_CFG() m_PcbSelectionVisibilityRatio = 1.0; + m_MinimumSegmentLength = 50; + loadFromConfigFile(); } @@ -437,6 +440,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) &m_PcbSelectionVisibilityRatio, m_PcbSelectionVisibilityRatio, 0.0, 1.0 ) ); + configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::MinimumSegmentLength, + &m_MinimumSegmentLength, + m_MinimumSegmentLength, 10, 1000 ) ); + // Special case for trace mask setting...we just grab them and set them immediately // Because we even use wxLogTrace inside of advanced config wxString traceMasks; diff --git a/common/font/outline_decomposer.cpp b/common/font/outline_decomposer.cpp index 10bcff5982..b89763449b 100644 --- a/common/font/outline_decomposer.cpp +++ b/common/font/outline_decomposer.cpp @@ -24,6 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include @@ -176,10 +177,8 @@ bool OUTLINE_DECOMPOSER::approximateCubicBezierCurve( GLYPH_POINTS& aResul { wxASSERT( aCubicBezier.size() == 4 ); - // minimumSegmentLength defines the "smoothness" of the - // curve-to-straight-segments conversion: the larger, the coarser - // TODO: find out what the minimum segment length should really be! - constexpr int minimumSegmentLength = 10; + + static int minimumSegmentLength = ADVANCED_CFG::GetCfg().m_MinimumSegmentLength; BEZIER_POLY converter( aCubicBezier ); converter.GetPoly( aResult, minimumSegmentLength ); diff --git a/include/advanced_config.h b/include/advanced_config.h index caf0ddf43d..e77ab673d2 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -498,6 +498,17 @@ public: * Default value: 1 */ double m_PcbSelectionVisibilityRatio; + + /** + * Length of the minimum segment for the outline decomposer. This is in IU, so + * it is nm in pcbnew and 100nm in eeschema. + * + * Setting name: "MinimumSegmentLength" + * Valid values: 10 to 1000 + * Default value: 50 + */ + int m_MinimumSegmentLength; + ///@}