Scale junction dots from wirewidth, not linewidth.
Fixes https://gitlab.com/kicad/code/kicad/issues/9040
This commit is contained in:
parent
b32b04d27e
commit
d92d9898ad
|
@ -29,6 +29,8 @@
|
|||
#include <sch_junction.h>
|
||||
#include <schematic.h>
|
||||
#include <schematic_settings.h>
|
||||
#include <project/project_file.h>
|
||||
#include <project/net_settings.h>
|
||||
|
||||
|
||||
PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aWindow, SCH_EDIT_FRAME* aFrame ) :
|
||||
|
@ -132,35 +134,8 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
|
|||
settings.m_DefaultLineWidth = (int) m_lineWidth.GetValue();
|
||||
settings.m_PinSymbolSize = (int) m_pinSymbolSize.GetValue();
|
||||
|
||||
// Get the current working size in case of problem with wxChoice widget results
|
||||
int currJunctionDotSize = settings.m_JunctionSize;
|
||||
// See if user has made a junction dot size selection
|
||||
int currDotSizeIndex = m_choiceJunctionDotSize->GetSelection();
|
||||
|
||||
if( currDotSizeIndex != wxNOT_FOUND )
|
||||
{
|
||||
EESCHEMA_SETTINGS* projSettings =
|
||||
dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
|
||||
|
||||
wxCHECK( projSettings, false );
|
||||
|
||||
if( currDotSizeIndex )
|
||||
{
|
||||
// Junction dots are scaled value of default line width
|
||||
currJunctionDotSize =
|
||||
settings.m_DefaultLineWidth
|
||||
* projSettings->m_Drawing.junction_size_mult_list[currDotSizeIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't set to zero or else it's set to min of 10 mils in "sch_painter.cpp"
|
||||
currJunctionDotSize = 1;
|
||||
}
|
||||
|
||||
settings.m_JunctionSizeChoice = currDotSizeIndex; // Store to set pulldown next time
|
||||
}
|
||||
|
||||
settings.m_JunctionSize = currJunctionDotSize;
|
||||
if( m_choiceJunctionDotSize->GetSelection() != wxNOT_FOUND )
|
||||
settings.m_JunctionSizeChoice = m_choiceJunctionDotSize->GetSelection();
|
||||
|
||||
settings.m_IntersheetRefsShow = m_showIntersheetsReferences->GetValue();
|
||||
settings.m_IntersheetRefsFormatShort = !m_radioFormatStandard->GetValue();
|
||||
|
|
|
@ -115,6 +115,16 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
|
|||
if( dlg.ShowQuasiModal() == wxID_OK )
|
||||
{
|
||||
Prj().GetProjectFile().NetSettings().ResolveNetClassAssignments( true );
|
||||
|
||||
EESCHEMA_SETTINGS* cfg = static_cast<EESCHEMA_SETTINGS*>( config() );
|
||||
|
||||
Schematic().Settings().m_JunctionSize =
|
||||
Prj().GetProjectFile().NetSettings().m_NetClasses.GetDefaultPtr()->GetWireWidth()
|
||||
* cfg->m_Drawing.junction_size_mult_list[ cfg->m_Drawing.junction_size_choice ];
|
||||
|
||||
if( Schematic().Settings().m_JunctionSize < 1 )
|
||||
Schematic().Settings().m_JunctionSize = 1;
|
||||
|
||||
SaveProjectSettings();
|
||||
|
||||
Kiway().CommonSettingsChanged( false, true );
|
||||
|
|
|
@ -99,20 +99,19 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
|||
&m_IntersheetRefsSuffix, defaultIntersheetsRefSuffix ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_line_thickness",
|
||||
&m_DefaultLineWidth, Mils2iu( defaultLineThickness ),
|
||||
Mils2iu( 5 ), Mils2iu( 1000 ), 1 / IU_PER_MILS ) );
|
||||
&m_DefaultLineWidth, Mils2iu( defaultLineThickness ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
1 / IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_wire_thickness",
|
||||
&m_DefaultWireThickness, Mils2iu( defaultWireThickness ),
|
||||
Mils2iu( 5 ), Mils2iu( 1000 ), 1 / IU_PER_MILS ) );
|
||||
&m_DefaultWireThickness, Mils2iu( defaultWireThickness ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
1 / IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_bus_thickness",
|
||||
&m_DefaultBusThickness, Mils2iu( defaultBusThickness ),
|
||||
Mils2iu( 5 ), Mils2iu( 1000 ), 1 / IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_text_size",
|
||||
&m_DefaultTextSize,
|
||||
Mils2iu( defaultTextSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
&m_DefaultTextSize, Mils2iu( defaultTextSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
1 / IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<double>( "drawing.text_offset_ratio",
|
||||
|
@ -122,13 +121,12 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
|||
&m_LabelSizeRatio, DEFAULT_LABEL_SIZE_RATIO, 0.0, 2.0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.pin_symbol_size",
|
||||
&m_PinSymbolSize,
|
||||
Mils2iu( defaultPinSymbolSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
&m_PinSymbolSize, Mils2iu( defaultPinSymbolSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
1 / IU_PER_MILS ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_junction_size",
|
||||
&m_JunctionSize,
|
||||
Mils2iu( defaultJunctionSize ), Mils2iu( 5 ), Mils2iu( 1000 ), 1 / IU_PER_MILS ) );
|
||||
&m_JunctionSize, Mils2iu( defaultJunctionSize ), Mils2iu( 5 ), Mils2iu( 1000 ),
|
||||
1 / IU_PER_MILS ) );
|
||||
|
||||
// User choice for junction dot size ( e.g. none = 0, smallest = 1, small = 2, etc )
|
||||
m_params.emplace_back( new PARAM<int>( "drawing.junction_size_choice",
|
||||
|
@ -162,7 +160,9 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
|
|||
{
|
||||
if( !entry.contains( "name" ) || !entry.contains( "url" )
|
||||
|| !entry.contains( "visible" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TEMPLATE_FIELDNAME field( entry["name"].get<wxString>() );
|
||||
field.m_URL = entry["url"].get<bool>();
|
||||
|
|
Loading…
Reference in New Issue