Fix some issues with incorrectly scaled defaults given in mils.
This commit is contained in:
parent
ed39b33d74
commit
69fac89e86
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2020 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -42,13 +42,13 @@
|
||||||
#define DEFAULTSELECTIONTHICKNESS 3
|
#define DEFAULTSELECTIONTHICKNESS 3
|
||||||
|
|
||||||
///< The default line width in mils. (can be changed in preference menu)
|
///< The default line width in mils. (can be changed in preference menu)
|
||||||
#define DEFAULT_LINE_THICKNESS 6
|
#define DEFAULT_LINE_WIDTH_MILS 6
|
||||||
|
|
||||||
///< The default wire width in mils. (can be changed in preference menu)
|
///< The default wire width in mils. (can be changed in preference menu)
|
||||||
#define DEFAULT_WIRE_THICKNESS 6
|
#define DEFAULT_WIRE_WIDTH_MILS 6
|
||||||
|
|
||||||
///< The default bus width in mils. (can be changed in preference menu)
|
///< The default bus width in mils. (can be changed in preference menu)
|
||||||
#define DEFAULT_BUS_THICKNESS 12
|
#define DEFAULT_BUS_WIDTH_MILS 12
|
||||||
|
|
||||||
///< The default noconnect size in mils.
|
///< The default noconnect size in mils.
|
||||||
#define DEFAULT_NOCONNECT_SIZE 48
|
#define DEFAULT_NOCONNECT_SIZE 48
|
||||||
|
|
|
@ -120,7 +120,7 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||||
&m_AutoplaceFields.align_to_grid, true ) );
|
&m_AutoplaceFields.align_to_grid, true ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "drawing.default_bus_thickness",
|
m_params.emplace_back( new PARAM<int>( "drawing.default_bus_thickness",
|
||||||
&m_Drawing.default_bus_thickness, DEFAULT_BUS_THICKNESS ) );
|
&m_Drawing.default_bus_thickness, DEFAULT_BUS_WIDTH_MILS ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "drawing.default_junction_size",
|
m_params.emplace_back( new PARAM<int>( "drawing.default_junction_size",
|
||||||
&m_Drawing.default_junction_size, DEFAULT_JUNCTION_DIAM ) );
|
&m_Drawing.default_junction_size, DEFAULT_JUNCTION_DIAM ) );
|
||||||
|
@ -128,11 +128,11 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||||
m_params.emplace_back( new PARAM<int>( "drawing.pin_symbol_size",
|
m_params.emplace_back( new PARAM<int>( "drawing.pin_symbol_size",
|
||||||
&m_Drawing.pin_symbol_size, DEFAULT_TEXT_SIZE / 2 ) );
|
&m_Drawing.pin_symbol_size, DEFAULT_TEXT_SIZE / 2 ) );
|
||||||
|
|
||||||
m_params.emplace_back(
|
m_params.emplace_back( new PARAM<double>( "drawing.text_offset_ratio",
|
||||||
new PARAM<double>( "drawing.text_offset_ratio", &m_Drawing.text_offset_ratio, 0.08 ) );
|
&m_Drawing.text_offset_ratio, 0.08 ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "drawing.default_line_thickness",
|
m_params.emplace_back( new PARAM<int>( "drawing.default_line_thickness",
|
||||||
&m_Drawing.default_line_thickness, DEFAULT_LINE_THICKNESS ) );
|
&m_Drawing.default_line_thickness, DEFAULT_LINE_WIDTH_MILS ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "drawing.default_repeat_offset_x",
|
m_params.emplace_back( new PARAM<int>( "drawing.default_repeat_offset_x",
|
||||||
&m_Drawing.default_repeat_offset_x, 0 ) );
|
&m_Drawing.default_repeat_offset_x, 0 ) );
|
||||||
|
@ -141,10 +141,10 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
|
||||||
&m_Drawing.default_repeat_offset_y, 100 ) );
|
&m_Drawing.default_repeat_offset_y, 100 ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "drawing.default_wire_thickness",
|
m_params.emplace_back( new PARAM<int>( "drawing.default_wire_thickness",
|
||||||
&m_Drawing.default_wire_thickness, DEFAULT_WIRE_THICKNESS ) );
|
&m_Drawing.default_wire_thickness, DEFAULT_WIRE_WIDTH_MILS ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>(
|
m_params.emplace_back( new PARAM<int>( "drawing.default_text_size",
|
||||||
"drawing.default_text_size", &m_Drawing.default_text_size, DEFAULT_TEXT_SIZE ) );
|
&m_Drawing.default_text_size, DEFAULT_TEXT_SIZE ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<wxString>( "drawing.field_names",
|
m_params.emplace_back( new PARAM<wxString>( "drawing.field_names",
|
||||||
&m_Drawing.field_names, "" ) );
|
&m_Drawing.field_names, "" ) );
|
||||||
|
|
|
@ -182,7 +182,7 @@ int SCH_BUS_WIRE_ENTRY::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return std::max( Schematic()->Settings().m_DefaultWireThickness, 1 );
|
return std::max( Schematic()->Settings().m_DefaultWireThickness, 1 );
|
||||||
|
|
||||||
return DEFAULT_WIRE_THICKNESS;
|
return Mils2iu( DEFAULT_WIRE_WIDTH_MILS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ int SCH_BUS_BUS_ENTRY::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return std::max( Schematic()->Settings().m_DefaultBusThickness, 1 );
|
return std::max( Schematic()->Settings().m_DefaultBusThickness, 1 );
|
||||||
|
|
||||||
return DEFAULT_BUS_THICKNESS;
|
return Mils2iu( DEFAULT_BUS_WIDTH_MILS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ typedef std::unordered_set<SCH_ITEM*> SCH_ITEM_SET;
|
||||||
class STROKE_PARAMS
|
class STROKE_PARAMS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_THICKNESS ),
|
STROKE_PARAMS( int aWidth = Mils2iu( DEFAULT_LINE_WIDTH_MILS ),
|
||||||
PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT,
|
PLOT_DASH_TYPE aPlotStyle = PLOT_DASH_TYPE::DEFAULT,
|
||||||
const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) :
|
const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) :
|
||||||
m_width( aWidth ),
|
m_width( aWidth ),
|
||||||
|
|
|
@ -47,9 +47,9 @@ SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) :
|
||||||
|
|
||||||
switch( layer )
|
switch( layer )
|
||||||
{
|
{
|
||||||
default: m_layer = LAYER_NOTES; break;
|
default: m_layer = LAYER_NOTES; break;
|
||||||
case LAYER_WIRE: m_layer = LAYER_WIRE; break;
|
case LAYER_WIRE: m_layer = LAYER_WIRE; break;
|
||||||
case LAYER_BUS: m_layer = LAYER_BUS; break;
|
case LAYER_BUS: m_layer = LAYER_BUS; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ int SCH_LINE::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return Schematic()->Settings().m_DefaultLineWidth;
|
return Schematic()->Settings().m_DefaultLineWidth;
|
||||||
|
|
||||||
return DEFAULT_LINE_THICKNESS;
|
return Mils2iu( DEFAULT_LINE_WIDTH_MILS );
|
||||||
|
|
||||||
case LAYER_WIRE:
|
case LAYER_WIRE:
|
||||||
if( m_stroke.GetWidth() > 0 )
|
if( m_stroke.GetWidth() > 0 )
|
||||||
|
@ -299,7 +299,7 @@ int SCH_LINE::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return Schematic()->Settings().m_DefaultWireThickness;
|
return Schematic()->Settings().m_DefaultWireThickness;
|
||||||
|
|
||||||
return DEFAULT_WIRE_THICKNESS;
|
return Mils2iu( DEFAULT_WIRE_WIDTH_MILS );
|
||||||
|
|
||||||
case LAYER_BUS:
|
case LAYER_BUS:
|
||||||
if( m_stroke.GetWidth() > 0 )
|
if( m_stroke.GetWidth() > 0 )
|
||||||
|
@ -311,7 +311,7 @@ int SCH_LINE::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return Schematic()->Settings().m_DefaultBusThickness;
|
return Schematic()->Settings().m_DefaultBusThickness;
|
||||||
|
|
||||||
return DEFAULT_BUS_THICKNESS;
|
return Mils2iu( DEFAULT_BUS_WIDTH_MILS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,12 +81,12 @@ SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS() :
|
||||||
m_OverrideItemColors( false ),
|
m_OverrideItemColors( false ),
|
||||||
m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ),
|
m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ),
|
||||||
m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ),
|
m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ),
|
||||||
m_DefaultWireThickness( DEFAULT_WIRE_THICKNESS * IU_PER_MILS ),
|
m_DefaultWireThickness( DEFAULT_WIRE_WIDTH_MILS * IU_PER_MILS ),
|
||||||
m_DefaultBusThickness( DEFAULT_BUS_THICKNESS * IU_PER_MILS ),
|
m_DefaultBusThickness( DEFAULT_BUS_WIDTH_MILS * IU_PER_MILS ),
|
||||||
m_PinSymbolSize( DEFAULT_TEXT_SIZE * IU_PER_MILS / 2 ),
|
m_PinSymbolSize( DEFAULT_TEXT_SIZE * IU_PER_MILS / 2 ),
|
||||||
m_JunctionSize( DEFAULT_JUNCTION_DIAM * IU_PER_MILS )
|
m_JunctionSize( DEFAULT_JUNCTION_DIAM * IU_PER_MILS )
|
||||||
{
|
{
|
||||||
SetDefaultPenWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS );
|
SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS );
|
||||||
|
|
||||||
m_minPenWidth = ADVANCED_CFG::GetCfg().m_MinPlotPenWidth * IU_PER_MM;
|
m_minPenWidth = ADVANCED_CFG::GetCfg().m_MinPlotPenWidth * IU_PER_MM;
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,7 +477,7 @@ void SCH_SEXPR_PARSER::parseStroke( STROKE_PARAMS& aStroke )
|
||||||
wxCHECK_RET( CurTok() == T_stroke,
|
wxCHECK_RET( CurTok() == T_stroke,
|
||||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a stroke." ) );
|
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a stroke." ) );
|
||||||
|
|
||||||
aStroke.SetWidth( Mils2iu( DEFAULT_LINE_THICKNESS ) );
|
aStroke.SetWidth( Mils2iu( DEFAULT_LINE_WIDTH_MILS ) );
|
||||||
aStroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT );
|
aStroke.SetPlotStyle( PLOT_DASH_TYPE::DEFAULT );
|
||||||
aStroke.SetColor( COLOR4D::UNSPECIFIED );
|
aStroke.SetColor( COLOR4D::UNSPECIFIED );
|
||||||
|
|
||||||
|
|
|
@ -514,7 +514,7 @@ int SCH_SHEET::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return Schematic()->Settings().m_DefaultLineWidth;
|
return Schematic()->Settings().m_DefaultLineWidth;
|
||||||
|
|
||||||
return DEFAULT_LINE_THICKNESS;
|
return Mils2iu( DEFAULT_LINE_WIDTH_MILS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ int SCH_SHEET_PIN::GetPenWidth() const
|
||||||
if( Schematic() )
|
if( Schematic() )
|
||||||
return Schematic()->Settings().m_DefaultLineWidth;
|
return Schematic()->Settings().m_DefaultLineWidth;
|
||||||
|
|
||||||
return DEFAULT_LINE_THICKNESS;
|
return Mils2iu( DEFAULT_LINE_WIDTH_MILS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,9 @@ const int schSettingsSchemaVersion = 1;
|
||||||
|
|
||||||
SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
|
SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
|
||||||
NESTED_SETTINGS( "schematic", schSettingsSchemaVersion, aParent, aPath ),
|
NESTED_SETTINGS( "schematic", schSettingsSchemaVersion, aParent, aPath ),
|
||||||
m_DefaultLineWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS ),
|
m_DefaultLineWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS ),
|
||||||
m_DefaultWireThickness( DEFAULT_WIRE_THICKNESS * IU_PER_MILS ),
|
m_DefaultWireThickness( DEFAULT_WIRE_WIDTH_MILS * IU_PER_MILS ),
|
||||||
m_DefaultBusThickness( DEFAULT_BUS_THICKNESS * IU_PER_MILS ),
|
m_DefaultBusThickness( DEFAULT_BUS_WIDTH_MILS * IU_PER_MILS ),
|
||||||
m_DefaultTextSize( DEFAULT_TEXT_SIZE * IU_PER_MILS ),
|
m_DefaultTextSize( DEFAULT_TEXT_SIZE * IU_PER_MILS ),
|
||||||
m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ),
|
m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ),
|
||||||
m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ),
|
m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ),
|
||||||
|
@ -59,11 +59,11 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
||||||
EESCHEMA_SETTINGS* appSettings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
EESCHEMA_SETTINGS* appSettings = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||||
|
|
||||||
int defaultLineThickness =
|
int defaultLineThickness =
|
||||||
appSettings ? appSettings->m_Drawing.default_line_thickness : DEFAULT_LINE_THICKNESS;
|
appSettings ? appSettings->m_Drawing.default_line_thickness : DEFAULT_LINE_WIDTH_MILS;
|
||||||
int defaultWireThickness =
|
int defaultWireThickness =
|
||||||
appSettings ? appSettings->m_Drawing.default_wire_thickness : DEFAULT_WIRE_THICKNESS;
|
appSettings ? appSettings->m_Drawing.default_wire_thickness : DEFAULT_WIRE_WIDTH_MILS;
|
||||||
int defaultBusThickness =
|
int defaultBusThickness =
|
||||||
appSettings ? appSettings->m_Drawing.default_bus_thickness : DEFAULT_BUS_THICKNESS;
|
appSettings ? appSettings->m_Drawing.default_bus_thickness : DEFAULT_BUS_WIDTH_MILS;
|
||||||
int defaultTextSize =
|
int defaultTextSize =
|
||||||
appSettings ? appSettings->m_Drawing.default_text_size : DEFAULT_TEXT_SIZE;
|
appSettings ? appSettings->m_Drawing.default_text_size : DEFAULT_TEXT_SIZE;
|
||||||
int defaultPinSymbolSize =
|
int defaultPinSymbolSize =
|
||||||
|
|
|
@ -47,7 +47,7 @@ SYMBOL_EDITOR_SETTINGS::SYMBOL_EDITOR_SETTINGS() :
|
||||||
SetLegacyFilename( "eeschema" );
|
SetLegacyFilename( "eeschema" );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "defaults.line_width",
|
m_params.emplace_back( new PARAM<int>( "defaults.line_width",
|
||||||
&m_Defaults.line_width, DEFAULT_LINE_THICKNESS ) );
|
&m_Defaults.line_width, DEFAULT_LINE_WIDTH_MILS ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<int>( "defaults.text_size",
|
m_params.emplace_back( new PARAM<int>( "defaults.text_size",
|
||||||
&m_Defaults.text_size, DEFAULT_TEXT_SIZE ) );
|
&m_Defaults.text_size, DEFAULT_TEXT_SIZE ) );
|
||||||
|
|
|
@ -143,7 +143,7 @@ SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAM
|
||||||
|
|
||||||
GetRenderSettings()->m_ShowHiddenText = true;
|
GetRenderSettings()->m_ShowHiddenText = true;
|
||||||
GetRenderSettings()->m_ShowHiddenPins = true;
|
GetRenderSettings()->m_ShowHiddenPins = true;
|
||||||
GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_THICKNESS * IU_PER_MILS );
|
GetRenderSettings()->SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * IU_PER_MILS );
|
||||||
|
|
||||||
setupTools();
|
setupTools();
|
||||||
setupUIConditions();
|
setupUIConditions();
|
||||||
|
|
Loading…
Reference in New Issue