7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

RENDER_SETTINGS: try a slightly modified dot calculation.

This commit is contained in:
jean-pierre charras 2024-08-25 16:30:08 +02:00
parent 22e39c97fb
commit ae001d7e19

View File

@ -54,13 +54,13 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
}
#if 1
constexpr double correction = 0.8; // Looks best visually and works on GTK and MSW
#if 0
constexpr double correction = 0.8; // Looks best visually
#else
constexpr double correction = 1.0; // Matches ISO 128-2, but creates issues on GTK and MSW:
constexpr double correction = 1.0; // Matches ISO 128-2, but can creates issues on GTK and MSW:
// "dots" are not always visible depending on the zoom level
// because they create 0 lenght lines
// So they will drawn as segments, even with correction = 1.0
#endif
@ -72,7 +72,9 @@ double RENDER_SETTINGS::GetDashLength( int aLineWidth ) const
double RENDER_SETTINGS::GetDotLength( int aLineWidth ) const
{
return ( 1.0 - correction ) * aLineWidth;
// The minimal length scale is arbitrary set to 0.2 after trials
// 0 lenght can create drawing issues
return std::max( ( 1.0 - correction ), 0.2 ) * aLineWidth;
}