From 2cbae18598425acff3a1793283708608e5cd8839 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 6 Jun 2020 13:57:28 -0400 Subject: [PATCH] Remove PCBNEW_SETTINGS dependence from PCB_PLOT_PARAMS --- pcbnew/dialogs/dialog_export_svg.cpp | 5 +++++ pcbnew/dialogs/dialog_plot.cpp | 5 +++++ pcbnew/pcb_plot_params.cpp | 18 ++---------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index d584dae4c7..892f255b21 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -310,6 +310,11 @@ bool DIALOG_EXPORT_SVG::CreateSVGFile( const wxString& aFullFileName ) m_board->SetAuxOrigin( origin ); } + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + PCBNEW_SETTINGS* cfg = mgr.GetAppSettings(); + + plot_opts.SetColorSettings( mgr.GetColorSettings( cfg->m_ColorTheme ) ); + LOCALE_IO toggle; SVG_PLOTTER* plotter = (SVG_PLOTTER*) StartPlotBoard( m_board, &plot_opts, UNDEFINED_LAYER, diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 9077f62f5d..74e3d5c181 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -738,6 +738,11 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) applyPlotSettings(); + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + PCBNEW_SETTINGS* cfg = mgr.GetAppSettings(); + + m_plotOpts.SetColorSettings( mgr.GetColorSettings( cfg->m_ColorTheme ) ); + m_plotOpts.SetSketchPadLineWidth( board->GetDesignSettings().GetLineThickness( F_Fab ) ); // If no layer selected, we have nothing plotted. diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 2058b18614..20d470cb81 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -28,11 +28,8 @@ #include // for KiROUND #include #include -#include -#include #include #include -#include #define PLOT_LINEWIDTH_MIN ( 0.02 * IU_PER_MM ) // min value for default line thickness @@ -149,19 +146,8 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_sketchPadLineWidth = Millimeter2iu( 0.1 ); // line width to plot items in outline mode - if( PgmOrNull() ) - { - SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); - auto app = mgr.GetAppSettings(); - - m_colors = mgr.GetColorSettings( app->m_ColorTheme ); - m_default_colors = nullptr; - } - else - { - m_default_colors = std::make_shared(); - m_colors = m_default_colors.get(); - } + m_default_colors = std::make_shared(); + m_colors = m_default_colors.get(); } void PCB_PLOT_PARAMS::SetGerberPrecision( int aPrecision )