diff -ru kicad-2010.04.06/common/dcsvg.cpp kicad-2010.04.06-new/common/dcsvg.cpp
--- kicad-2010.04.06/common/dcsvg.cpp 2009-10-13 14:49:08.000000000 +0200
+++ kicad-2010.04.06-new/common/dcsvg.cpp 2010-05-01 15:56:56.000000000 +0200
@@ -157,8 +157,8 @@
write( s );
s.Printf( wxT( " version=\"1.1\"\n" ) );
write( s );
- s.Printf( wxT( " width=\"%.2gcm\" height=\"%.2gcm\" viewBox=\"0 0 %d %d \"\n" ),
- float (Width) / dpi * 2.54, float (Height) / dpi * 2.54, Width, Height );
+ s.Printf( wxT( " width=\"%gin\" height=\"%gin\" viewBox=\"0 0 %d %d \"\n" ),
+ double (Width) / dpi, double (Height) / dpi, Width, Height );
write( s );
s.Printf( wxT( ">\n" ) );
write( s );
diff -ru kicad-2010.04.06/eeschema/dialog_SVG_print.cpp kicad-2010.04.06-new/eeschema/dialog_SVG_print.cpp
--- kicad-2010.04.06/eeschema/dialog_SVG_print.cpp 2010-03-28 17:46:49.000000000 +0200
+++ kicad-2010.04.06-new/eeschema/dialog_SVG_print.cpp 2010-05-01 15:59:29.000000000 +0200
@@ -230,12 +230,16 @@
old_org = screen->m_DrawOrg;
screen->m_DrawOrg.x = screen->m_DrawOrg.y = 0;
screen->m_StartVisu.x = screen->m_StartVisu.y = 0;
- SheetSize = screen->ReturnPageSize( );
+ SheetSize = screen->ReturnPageSize( ); // page size in 1/1000 inch, ie in internal units
screen->SetScalingFactor( 1.0 );
WinEDA_DrawPanel* panel = frame->DrawPanel;
- wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y );
+ SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed
+ // to print floating point numbers like 1.3)
+
+ float dpi = (float)frame->m_InternalUnits;
+ wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_Rect tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc );
@@ -248,8 +252,6 @@
panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
screen->m_IsPrinting = true;
- SetLocaleTo_C_standard( ); // Switch the locale to standard C (needed
- // to print floating point numbers like 1.3)
frame->PrintPage( &dc, aPrint_Sheet_Ref, 1, false );
SetLocaleTo_Default( ); // revert to the current locale
screen->m_IsPrinting = false;
diff -ru kicad-2010.04.06/pcbnew/dialog_SVG_print.cpp kicad-2010.04.06-new/pcbnew/dialog_SVG_print.cpp
--- kicad-2010.04.06/pcbnew/dialog_SVG_print.cpp 2010-03-26 18:18:59.000000000 +0100
+++ kicad-2010.04.06-new/pcbnew/dialog_SVG_print.cpp 2010-05-01 16:02:53.000000000 +0200
@@ -38,7 +38,6 @@
{
private:
WinEDA_BasePcbFrame* m_Parent;
- int m_ImageXSize_mm;
wxConfig* m_Config;
long m_PrintMaskLayer;
wxCheckBox* m_BoxSelectLayer[32];
@@ -90,7 +89,6 @@
{
SetFocus(); // Make ESC key working
- m_ImageXSize_mm = 270;
if( m_Config )
{
m_Config->Read( PLOTSVGMODECOLOR_KEY, &s_Parameters.m_Print_Black_and_White );
@@ -245,7 +243,7 @@
/*
- * Routine actual print
+ * Actual print function.
*/
bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName,
BASE_SCREEN* screen,
@@ -255,7 +253,6 @@
wxPoint tmp_startvisu;
wxSize SheetSize; // Sheet size in internal units
wxPoint old_org;
- float dpi;
bool success = true;
/* Change frames and local settings */
@@ -269,28 +266,31 @@
SheetSize.y *= m_Parent->m_InternalUnits / 1000; // size in pixels
screen->SetScalingFactor( 1.0 );
- dpi = (float) SheetSize.x * 25.4 / m_ImageXSize_mm;
+ float dpi = (float)m_Parent->m_InternalUnits;
WinEDA_DrawPanel* panel = m_Parent->DrawPanel;
+ SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
+ // to print floating point numbers like 1.3)
wxSVGFileDC dc( FullFileName, SheetSize.x, SheetSize.y, dpi );
EDA_Rect tmp = panel->m_ClipBox;
GRResetPenAndBrush( &dc );
- s_Parameters.m_PenDefaultSize = ReturnValueFromTextCtrl( *m_DialogPenWidth,
- m_Parent->m_InternalUnits );
GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? false : true );
s_Parameters.m_DrillShapeOpt = PRINT_PARAMETERS::FULL_DRILL_SHAPE;
- panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 );
- panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight(
- 0x7FFFFF0 );
+ panel->m_ClipBox.SetX( 0 );
+ panel->m_ClipBox.SetY( 0 );
+ panel->m_ClipBox.SetWidth( 0x7FFFFF0 );
+ panel->m_ClipBox.SetHeight( 0x7FFFFF0 );
screen->m_IsPrinting = true;
- SetLocaleTo_C_standard(); // Switch the locale to standard C (needed
- // to print floating point numbers like 1.3)
+
+ int bg_color = g_DrawBgColor;
+ g_DrawBgColor = WHITE;
m_Parent->PrintPage( &dc, aPrint_Frame_Ref, m_PrintMaskLayer, false, &s_Parameters);
+ g_DrawBgColor = bg_color;
SetLocaleTo_Default(); // revert to the current locale
screen->m_IsPrinting = false;
panel->m_ClipBox = tmp;