]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmprint.cpp
improve best size calculation; notably account for wxDP_ALLOWNONE
[wxWidgets.git] / src / html / htmprint.cpp
index e4dbbcfda7bf39d43a7c516c27b72fde8679c169..158483e3a99481c77800505803fa7058fa0a27e7 100644 (file)
@@ -206,7 +206,8 @@ void wxHtmlPrintout::OnPreparePrinting()
     wxDisplaySize(&scr_w, &scr_h);
     GetDC()->GetSize(&dc_w, &dc_h);
 
-    GetDC()->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);
+    GetDC()->SetUserScale((double)dc_w / (double)pageWidth,
+                          (double)dc_h / (double)pageHeight);
 
     /* prepare headers/footers renderer: */
 
@@ -412,7 +413,8 @@ void wxHtmlPrintout::RenderPage(wxDC *dc, int page)
     GetPPIScreen(&ppiScreenX, &ppiScreenY);
     wxUnusedVar(ppiScreenX);
 
-    dc->SetUserScale((double)dc_w / (double)pageWidth, (double)dc_w / (double)pageWidth);
+    dc->SetUserScale((double)dc_w / (double)pageWidth,
+                     (double)dc_h / (double)pageHeight);
 
     m_Renderer->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY);