cleanup related to zoom definitions

This commit is contained in:
jean-pierre charras 2020-12-02 15:34:05 +01:00
parent b7564f6f05
commit fcce62f0a4
6 changed files with 21 additions and 82 deletions

View File

@ -198,11 +198,7 @@ void SCH_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
// change this config
// if( aCfg->m_Window.zoom_factors.empty() )
{
aCfg->m_Window.zoom_factors = { 0.05, 0.07,
0.1, 0.15, 0.2, 0.3, 0.5, 0.7,
1.0, 1.5, 2.0, 3.0, 4.5, 6.5,
10.0, 15.0, 20.0, 30.0, 45.0, 65.0,
100.0 };
aCfg->m_Window.zoom_factors = { ZOOM_LIST_EESCHEMA };
}
// ensure factors < MAX_ZOOM_FACTOR (useful only when the user will be

View File

@ -301,26 +301,7 @@ void GERBVIEW_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
if( aCfg->m_Window.zoom_factors.empty() )
{
aCfg->m_Window.zoom_factors = { 0.022,
0.035,
0.05,
0.08,
0.13,
0.22,
0.35,
0.6,
1.0,
2.2,
3.5,
5.0,
8.0,
13.0,
22.0,
35.0,
50.0,
80.0,
130.0,
220.0 };
aCfg->m_Window.zoom_factors = { ZOOM_LIST_GERBER };
}
for( double& factor : aCfg->m_Window.zoom_factors )

View File

@ -72,3 +72,16 @@
// Adjusted to display zoom level ~ 1 when the screen shows a 1:1 image.
// Obviously depends on the monitor, but this is an acceptable value.
#define ZOOM_COEFF 1.1
// List of predefined zooms used in zoom in/out from hotkeys and toolbar
#define ZOOM_LIST_GERBER 0.022, 0.035, 0.05, 0.08, 0.13, 0.22, 0.35, 0.6, 1.0,\
2.2, 3.5, 5.0, 8.0, 13.0, 22.0, 35.0, 50.0, 80.0, 130.0, 220.0
#define ZOOM_LIST_PCBNEW 0.13, 0.22, 0.35, 0.6, 1.0, 1.5, 2.2, 3.5, 5.0, 8.0, 13.0,\
20.0, 35.0, 50.0, 80.0, 130.0, 220.0, 300.0
#define ZOOM_LIST_PL_EDITOR 0.022, 0.035, 0.05, 0.08, 0.13, 0.22, 0.35, 0.6, 1.0, 2.2,\
3.5, 5.0, 8.0, 13.0, 22.0, 35.0, 50.0, 80.0, 130.0, 220.0
#define ZOOM_LIST_EESCHEMA 0.05, 0.07, 0.1, 0.15, 0.2, 0.3, 0.5, 0.7, 1.0, 1.5, 2.0,\
3.0, 4.5, 6.5, 10.0, 15.0, 20.0, 30.0, 45.0, 65.0, 100.0

View File

@ -482,28 +482,11 @@ void PL_EDITOR_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
"0.10 mm" };
}
if( aCfg->m_Window.zoom_factors.empty() )
// Currently values read from config file are not used because the user cannot
// change this config
// if( aCfg->m_Window.zoom_factors.empty() )
{
aCfg->m_Window.zoom_factors = { 0.022,
0.035,
0.05,
0.08,
0.13,
0.22,
0.35,
0.6,
1.0,
2.2,
3.5,
5.0,
8.0,
13.0,
22.0,
35.0,
50.0,
80.0,
130.0,
220.0 };
aCfg->m_Window.zoom_factors = { ZOOM_LIST_PL_EDITOR };
}
for( double& factor : aCfg->m_Window.zoom_factors )

View File

@ -446,24 +446,7 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow*
// change this config
//if( cfg->m_Window.zoom_factors.empty() )
{
cfg->m_Window.zoom_factors = { 0.13,
0.22,
0.35,
0.6,
1.0,
1.5,
2.2,
3.5,
5.0,
8.0,
13.0,
20.0,
35.0,
50.0,
80.0,
130.0,
220.0,
300.0 };
cfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW };
}
for( double& factor : cfg->m_Window.zoom_factors )

View File

@ -600,24 +600,7 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
// change this config
// if( aCfg->m_Window.zoom_factors.empty() )
{
aCfg->m_Window.zoom_factors = { 0.13,
0.22,
0.35,
0.6,
1.0,
1.5,
2.2,
3.5,
5.0,
8.0,
13.0,
20.0,
35.0,
50.0,
80.0,
130.0,
220.0,
300.0 };
aCfg->m_Window.zoom_factors = { ZOOM_LIST_PCBNEW };
}
for( double& factor : aCfg->m_Window.zoom_factors )