From 4e217d4028807d6cf473c829b2a511557cfbb3f8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 24 Apr 2020 16:52:50 +0200 Subject: [PATCH] SVG plotter: fix some issues: incorrect bitmap size and missing lines in header. From master branch. --- common/plotters/SVG_plotter.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 83e88cf1e4..87ee5c677a 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -6,8 +6,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 1992-2020 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 @@ -599,7 +599,7 @@ void SVG_PLOTTER::PlotImage( const wxImage& aImage, const wxPoint& aPos, fprintf( outputFile, "\n" ); } - fprintf( outputFile, "\"\npreserveAspectRatio=\"none\" height=\"%g\" width=\"%g\" />", + fprintf( outputFile, "\"\npreserveAspectRatio=\"none\" width=\"%g\" height=\"%g\" />", userToDeviceSize( drawsize.x ), userToDeviceSize( drawsize.y ) ); } @@ -663,7 +663,11 @@ bool SVG_PLOTTER::StartPlot() "\n", " \n", - "\n", + " width=\"%fcm\" height=\"%fcm\" viewBox=\"%d %d %d %d\">\n", (double) paperSize.x / m_IUsPerDecimil * 2.54 / 10000, (double) paperSize.y / m_IUsPerDecimil * 2.54 / 10000, origin.x, origin.y,