KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dpi_scaling_common.cpp File Reference
#include <dpi_scaling_common.h>
#include <optional>
#include <env_vars.h>
#include <settings/common_settings.h>
#include <kiplatform/ui.h>
#include <wx/log.h>
#include <wx/window.h>

Go to the source code of this file.

Functions

static std::optional< double > getKiCadConfiguredScale (const COMMON_SETTINGS &aConfig)
 Get a user-configured scale factor from KiCad config file.
 
static std::optional< double > getEnvironmentScale ()
 Get the toolkit scale factor from a user-set environment variable (for example GDK_SCALE on GTK).
 

Variables

const wxChar *const traceHiDpi = wxT( "KICAD_TRACE_HIGH_DPI" )
 Flag to enable trace for HiDPI scaling factors.
 

Function Documentation

◆ getEnvironmentScale()

static std::optional< double > getEnvironmentScale ( )
static

Get the toolkit scale factor from a user-set environment variable (for example GDK_SCALE on GTK).

Returns
the scale factor, if set

Definition at line 71 of file dpi_scaling_common.cpp.

References scale.

Referenced by DPI_SCALING_COMMON::GetContentScaleFactor(), and DPI_SCALING_COMMON::GetScaleFactor().

◆ getKiCadConfiguredScale()

static std::optional< double > getKiCadConfiguredScale ( const COMMON_SETTINGS aConfig)
static

Get a user-configured scale factor from KiCad config file.

Returns
the scale factor, if set

Definition at line 51 of file dpi_scaling_common.cpp.

References COMMON_SETTINGS::APPEARANCE::canvas_scale, COMMON_SETTINGS::m_Appearance, and scale.

Referenced by DPI_SCALING_COMMON::GetCanvasIsAutoScaled(), DPI_SCALING_COMMON::GetContentScaleFactor(), and DPI_SCALING_COMMON::GetScaleFactor().