⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236245 in webkit


Ignore:
Timestamp:
Sep 20, 2018, 12:16:44 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

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

Patch by Tomas Popela <​tpopela@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:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r236234 r236245  
     12018-09-20  Tomas Popela  <tpopela@redhat.com>
     2
     3        [GTK] Always prints in portrait when landscape is requested
     4        https://bugs.webkit.org/show_bug.cgi?id=189543
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        We have to change the surface size based on the requested orientation.
     9        Otherwise only portrait will be printed as it's hardcoded.
     10
     11        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
     12
    1132018-09-19  Dean Jackson  <dino@grorg.org>
    214
  • trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp

    r227728 r236245  
    135135            }
    136136        } else if (surfaceType == CAIRO_SURFACE_TYPE_PDF)
    137             cairo_pdf_surface_set_size(surface, width, height);
     137            switch (gtk_page_setup_get_orientation(m_pageSetup.get())) {
     138            case GTK_PAGE_ORIENTATION_PORTRAIT:
     139            case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
     140                cairo_pdf_surface_set_size(surface, width, height);
     141                break;
     142            case GTK_PAGE_ORIENTATION_LANDSCAPE:
     143            case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
     144                cairo_pdf_surface_set_size(surface, height, width);
     145                break;
     146            }
    138147    }
    139148
Note: See TracChangeset for help on using the changeset viewer.