Eeschema, symbol editor: re-enable PNG export and fix a minor issue in SVG export (was in B&W mode instead of color).

Add a comment in plotter.h to avoid other errors when selecting plotting mode B&W or color

Fixes: lp:1801058
https://bugs.launchpad.net/kicad/+bug/1801058
This commit is contained in:
jean-pierre charras 2018-11-02 09:23:16 +01:00
parent a55950bd68
commit 5e44686711
3 changed files with 16 additions and 16 deletions

View File

@ -5,7 +5,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) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2018 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
@ -119,12 +119,10 @@ void LIB_EDIT_FRAME::OnPlotCurrentComponent( wxCommandEvent& event )
void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg ) void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_jpeg )
{ {
wxSize image_size; // Make a screen copy of the canvas:
//fixme-gal do it properly wxSize image_size = GetGalCanvas()->GetClientSize();
// = m_canvas->GetClientSize(); wxClientDC dc( GetGalCanvas() );
#if 0
wxClientDC dc( m_canvas );
wxBitmap bitmap( image_size.x, image_size.y ); wxBitmap bitmap( image_size.x, image_size.y );
wxMemoryDC memdc; wxMemoryDC memdc;
@ -142,19 +140,18 @@ void LIB_EDIT_FRAME::CreatePNGorJPEGFile( const wxString& aFileName, bool aFmt_j
} }
image.Destroy(); image.Destroy();
#endif
} }
void LIB_EDIT_FRAME::SVG_PlotComponent( const wxString& aFullFileName ) void LIB_EDIT_FRAME::SVG_PlotComponent( const wxString& aFullFileName )
{ {
const bool plotBW = false; const bool plotColor = true;
const PAGE_INFO& pageInfo = GetScreen()->GetPageSettings(); const PAGE_INFO& pageInfo = GetScreen()->GetPageSettings();
SVG_PLOTTER* plotter = new SVG_PLOTTER(); SVG_PLOTTER* plotter = new SVG_PLOTTER();
plotter->SetPageSettings( pageInfo ); plotter->SetPageSettings( pageInfo );
plotter->SetDefaultLineWidth( GetDefaultLineThickness() ); plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
plotter->SetColorMode( plotBW ); plotter->SetColorMode( plotColor );
wxPoint plot_offset; wxPoint plot_offset;
const double scale = 1.0; const double scale = 1.0;

View File

@ -109,18 +109,18 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_EXPORT_PART, ID_LIBEDIT_EXPORT_PART,
_( "&Export Symbol..." ), _( "&Export Symbol..." ),
_( "Export the current symbol" ), _( "Create a library file containing only the current symbol" ),
KiBitmap( export_part_xpm ) ); KiBitmap( export_part_xpm ) );
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_PNG_FILE, ID_LIBEDIT_GEN_PNG_FILE,
_( "Export PNG..." ), _( "Export View as PNG..." ),
_( "Create a PNG file from the current view" ), _( "Create a PNG file from the current view" ),
KiBitmap( plot_xpm ) ); KiBitmap( plot_xpm ) );
AddMenuItem( fileMenu, AddMenuItem( fileMenu,
ID_LIBEDIT_GEN_SVG_FILE, ID_LIBEDIT_GEN_SVG_FILE,
_( "Export SVG..." ), _( "Export Symbol as SVG..." ),
_( "Create a SVG file from the current symbol" ), _( "Create a SVG file from the current symbol" ),
KiBitmap( plot_svg_xpm ) ); KiBitmap( plot_svg_xpm ) );

View File

@ -115,14 +115,17 @@ public:
virtual bool StartPlot() = 0; virtual bool StartPlot() = 0;
virtual bool EndPlot() = 0; virtual bool EndPlot() = 0;
virtual void SetNegative( bool _negative ) virtual void SetNegative( bool aNegative )
{ {
negativeMode = _negative; negativeMode = aNegative;
} }
virtual void SetColorMode( bool _color_mode ) /** Plot in B/W or color.
* @param aColorMode = true to plot in color, false to plot in black and white
*/
virtual void SetColorMode( bool aColorMode )
{ {
colorMode = _color_mode; colorMode = aColorMode;
} }
bool GetColorMode() const bool GetColorMode() const