Browse Source

Make outline font min segment length configurable

This was hard coded at 10IU, which was way too small for pcbnew and
still too small for schematic editor.  Instead, we set a default of 50
and allow the user to adjust (smaller for less powerful machines)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16568
newinvert
Seth Hillbrand 2 years ago
parent
commit
42e02552ac
  1. 7
      common/advanced_config.cpp
  2. 7
      common/font/outline_decomposer.cpp
  3. 11
      include/advanced_config.h

7
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;

7
common/font/outline_decomposer.cpp

@ -24,6 +24,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <advanced_config.h>
#include <font/outline_decomposer.h>
#include <bezier_curves.h>
@ -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 );

11
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;
///@}

Loading…
Cancel
Save