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

View File

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

View File

@ -115,14 +115,17 @@ public:
virtual bool StartPlot() = 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