Title: [236245] trunk/Source/WebKit
Revision
236245
Author
carlo...@webkit.org
Date
2018-09-20 00:16:44 -0700 (Thu, 20 Sep 2018)

Log Message

[GTK] Always prints in portrait when landscape is requested
https://bugs.webkit.org/show_bug.cgi?id=189543

Patch by Tomas Popela <tpop...@redhat.com> on 2018-09-20
Reviewed by Michael Catanzaro.

We have to change the surface size based on the requested orientation.
Otherwise only portrait will be printed as it's hardcoded.

* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236244 => 236245)


--- trunk/Source/WebKit/ChangeLog	2018-09-20 07:06:27 UTC (rev 236244)
+++ trunk/Source/WebKit/ChangeLog	2018-09-20 07:16:44 UTC (rev 236245)
@@ -1,3 +1,15 @@
+2018-09-20  Tomas Popela  <tpop...@redhat.com>
+
+        [GTK] Always prints in portrait when landscape is requested
+        https://bugs.webkit.org/show_bug.cgi?id=189543
+
+        Reviewed by Michael Catanzaro.
+
+        We have to change the surface size based on the requested orientation.
+        Otherwise only portrait will be printed as it's hardcoded.
+
+        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
+
 2018-09-19  Dean Jackson  <d...@grorg.org>
 
         Temporarily move fullscreen back to experimental features

Modified: trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp (236244 => 236245)


--- trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp	2018-09-20 07:06:27 UTC (rev 236244)
+++ trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp	2018-09-20 07:16:44 UTC (rev 236245)
@@ -134,7 +134,16 @@
                 break;
             }
         } else if (surfaceType == CAIRO_SURFACE_TYPE_PDF)
-            cairo_pdf_surface_set_size(surface, width, height);
+            switch (gtk_page_setup_get_orientation(m_pageSetup.get())) {
+            case GTK_PAGE_ORIENTATION_PORTRAIT:
+            case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
+                cairo_pdf_surface_set_size(surface, width, height);
+                break;
+            case GTK_PAGE_ORIENTATION_LANDSCAPE:
+            case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
+                cairo_pdf_surface_set_size(surface, height, width);
+                break;
+            }
     }
 
     void endPage(cairo_t* cr) override
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to