diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index 83f1003d71..5ac59f4980 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -321,7 +321,7 @@ void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll ) createPSFile( aPlotAll, getPlotFrameRef(), &renderSettings ); break; case PLOT_FORMAT::DXF: - CreateDXFFile( aPlotAll, getPlotFrameRef() ); + CreateDXFFile( aPlotAll, getPlotFrameRef(), &renderSettings ); break; case PLOT_FORMAT::PDF: createPDFFile( aPlotAll, getPlotFrameRef(), &renderSettings ); @@ -330,7 +330,7 @@ void DIALOG_PLOT_SCHEMATIC::PlotSchematic( bool aPlotAll ) createSVGFile( aPlotAll, getPlotFrameRef(), &renderSettings ); break; case PLOT_FORMAT::HPGL: - createHPGLFile( aPlotAll, getPlotFrameRef() ); + createHPGLFile( aPlotAll, getPlotFrameRef(), &renderSettings ); break; } } diff --git a/eeschema/dialogs/dialog_plot_schematic.h b/eeschema/dialogs/dialog_plot_schematic.h index 40a3fabd04..c9930fc3ca 100644 --- a/eeschema/dialogs/dialog_plot_schematic.h +++ b/eeschema/dialogs/dialog_plot_schematic.h @@ -106,8 +106,9 @@ private: void restoreEnvironment( PDF_PLOTTER* aPlotter, SCH_SHEET_PATH& aOldsheetpath ); // DXF - void CreateDXFFile( bool aPlotAll, bool aPlotFrameRef ); + void CreateDXFFile( bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS* aRenderSettings ); bool PlotOneSheetDXF( const wxString& aFileName, SCH_SCREEN* aScreen, + RENDER_SETTINGS* aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef ); // HPGL @@ -121,10 +122,10 @@ private: m_plotOriginOpt->SetSelection( aCenter ? 1 : 0 ); } - void createHPGLFile( bool aPlotAll, bool aPlotFrameRef ); + void createHPGLFile( bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS* aRenderSettings ); void SetHPGLPenWidth(); bool Plot_1_Page_HPGL( const wxString& aFileName, SCH_SCREEN* aScreen, - const PAGE_INFO& aPageInfo, + const PAGE_INFO& aPageInfo, RENDER_SETTINGS* aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef ); // PS diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp index a78d52c651..5e336c391c 100644 --- a/eeschema/plot_schematic_DXF.cpp +++ b/eeschema/plot_schematic_DXF.cpp @@ -38,7 +38,8 @@ #include -void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef ) +void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef, + RENDER_SETTINGS* aRenderSettings ) { SCH_EDIT_FRAME* schframe = m_parent; SCH_SCREEN* screen = schframe->GetScreen(); @@ -75,8 +76,8 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef ) wxString ext = DXF_PLOTTER::GetDefaultFileExtension(); wxFileName plotFileName = createPlotFileName( fname, ext, &reporter ); - if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, plot_offset, 1.0, - aPlotFrameRef ) ) + if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, aRenderSettings, + plot_offset, 1.0, aPlotFrameRef ) ) { msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() ); reporter.Report( msg, RPT_SEVERITY_ACTION ); @@ -104,20 +105,20 @@ void DIALOG_PLOT_SCHEMATIC::CreateDXFFile( bool aPlotAll, bool aPlotFrameRef ) } -bool DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF( const wxString& aFileName, - SCH_SCREEN* aScreen, - wxPoint aPlotOffset, - double aScale, - bool aPlotFrameRef ) +bool DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF( const wxString& aFileName, + SCH_SCREEN* aScreen, + RENDER_SETTINGS* aRenderSettings, + wxPoint aPlotOffset, + double aScale, + bool aPlotFrameRef ) { - KIGFX::SCH_RENDER_SETTINGS renderSettings; - renderSettings.LoadColors( getColorSettings() ); - renderSettings.SetDefaultPenWidth( 0 ); + aRenderSettings->LoadColors( getColorSettings() ); + aRenderSettings->SetDefaultPenWidth( 0 ); const PAGE_INFO& pageInfo = aScreen->GetPageSettings(); DXF_PLOTTER* plotter = new DXF_PLOTTER(); - plotter->SetRenderSettings( &renderSettings ); + plotter->SetRenderSettings( aRenderSettings ); plotter->SetPageSettings( pageInfo ); plotter->SetColorMode( getModeColor() ); // Currently, plot units are in decimil diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 326e995e9c..c3f24a583b 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -85,7 +85,8 @@ void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth() } -void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef ) +void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef, + RENDER_SETTINGS* aRenderSettings ) { SCH_SCREEN* screen = m_parent->GetScreen(); SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); @@ -147,8 +148,8 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef ) LOCALE_IO toggle; - if( Plot_1_Page_HPGL( plotFileName.GetFullPath(), screen, plotPage, plotOffset, - plot_scale, aPlotFrameRef ) ) + if( Plot_1_Page_HPGL( plotFileName.GetFullPath(), screen, plotPage, aRenderSettings, + plotOffset, plot_scale, aPlotFrameRef ) ) { msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() ); reporter.Report( msg, RPT_SEVERITY_ACTION ); @@ -176,6 +177,7 @@ void DIALOG_PLOT_SCHEMATIC::createHPGLFile( bool aPlotAll, bool aPlotFrameRef ) bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL( const wxString& aFileName, SCH_SCREEN* aScreen, const PAGE_INFO& aPageInfo, + RENDER_SETTINGS* aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef ) @@ -184,6 +186,7 @@ bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL( const wxString& aFileName, // Currently, plot units are in decimil plotter->SetPageSettings( aPageInfo ); + plotter->SetRenderSettings( aRenderSettings ); plotter->RenderSettings()->LoadColors( getColorSettings() ); plotter->SetColorMode( getModeColor() ); plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );