qt5-webkit-pdf_scaling.patch 1.0 KB

12345678910111213141516171819202122232425
  1. From 24e655e27c68880cd71c762a27e1813e3300a4b3 Mon Sep 17 00:00:00 2001
  2. From: Alex Leray <alexandre@stdin.fr>
  3. Date: Wed, 10 Aug 2016 18:38:31 +0200
  4. Subject: [PATCH] Fix PDF scale issue with Point units
  5. Done by hardcoding the scalefactor to 72 (1 inch = 72 points).
  6. ---
  7. Source/WebKit/qt/WidgetApi/qwebframe.cpp | 4 ++--
  8. 1 file changed, 2 insertions(+), 2 deletions(-)
  9. diff --git a/Source/WebKit/qt/WidgetApi/qwebframe.cpp b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
  10. index e27d9b0f8f40..a35d5fbcc5ca 100644
  11. --- a/Source/WebKit/qt/WidgetApi/qwebframe.cpp
  12. +++ b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
  13. @@ -827,8 +827,8 @@ void QWebFrame::print(QPrinter *printer) const
  14. if (!painter.begin(printer))
  15. return;
  16. - const qreal zoomFactorX = (qreal)printer->logicalDpiX() / qt_defaultDpi();
  17. - const qreal zoomFactorY = (qreal)printer->logicalDpiY() / qt_defaultDpi();
  18. + const qreal zoomFactorX = (qreal)printer->logicalDpiX() / 72;
  19. + const qreal zoomFactorY = (qreal)printer->logicalDpiY() / 72;
  20. QRect qprinterRect = printer->pageRect();