← Back to team overview

kicad-developers team mailing list archive

patch: pcbnew printing "Fit to page" scale fix

 

This patch makes scale option "fit to page" do the same as in all other programs worldwide - produce biggest image that still fits to page.
 Pcbnew generates 1:1-scaled centered image instead.

--
Regards,
  Sergey A. Borshch            mailto: sb-sf@xxxxxxxxxxxxxxx
    SB ELDI ltd. Riga, Latvia
=== modified file 'pcbnew/printout_controler.cpp'
--- pcbnew/printout_controler.cpp	2013-02-12 17:41:13 +0000
+++ pcbnew/printout_controler.cpp	2013-03-10 21:38:01 +0000
@@ -194,7 +194,9 @@
 
     if( m_PrintParams.m_PrintScale == 0 )                //  fit in page
     {
-        userscale = 1.0;
+        double scaleX = m_Parent->GetPageSizeIU().x / boardBoundingBox.GetWidth();
+        double scaleY = m_Parent->GetPageSizeIU().x / boardBoundingBox.GetWidth();
+        userscale = scaleX < scaleY ? scaleX : scaleY;
     }


Follow ups