Scale GAL grid with DPI

This commit is contained in:
Jon Evans 2024-01-19 12:20:06 -05:00
parent 7975ad495b
commit e29baa75b4
3 changed files with 5 additions and 9 deletions

View File

@ -117,13 +117,13 @@ bool GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
if( m_options.m_gridLineWidth != m_gridLineWidth )
{
m_gridLineWidth = std::floor( m_options.m_gridLineWidth + 0.5 );
m_gridLineWidth = std::floor( m_options.m_scaleFactor * ( m_options.m_gridLineWidth + 0.5 ) );
refresh = true;
}
if( m_options.m_gridMinSpacing != m_gridMinSpacing )
{
m_gridMinSpacing = m_options.m_gridMinSpacing;
m_gridMinSpacing = m_options.m_scaleFactor * m_options.m_gridMinSpacing;
refresh = true;
}

View File

@ -509,6 +509,8 @@ bool OPENGL_GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions )
if( m_options.m_scaleFactor != GetScaleFactor() )
{
SetScaleFactor( m_options.m_scaleFactor );
m_gridLineWidth = m_options.m_scaleFactor * std::floor( m_options.m_gridLineWidth + 0.5 );
m_gridMinSpacing = m_options.m_scaleFactor * m_options.m_gridMinSpacing;
refresh = true;
}

View File

@ -414,14 +414,8 @@ void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std:
&aWindow->grid.override_graphics_idx, 15 ) );
}
#ifdef __WXMAC__
#define DEFAULT_GRID_THICKNESS 2.0
#else
#define DEFAULT_GRID_THICKNESS 1.0
#endif
m_params.emplace_back( new PARAM<double>( aJsonPath + ".grid.line_width",
&aWindow->grid.line_width, DEFAULT_GRID_THICKNESS ) );
&aWindow->grid.line_width, 1.0 ) );
m_params.emplace_back( new PARAM<double>( aJsonPath + ".grid.min_spacing",
&aWindow->grid.min_spacing, 10 ) );