Title: [171775] trunk/Source/WebKit2
Revision
171775
Author
[email protected]
Date
2014-07-29 16:01:47 -0700 (Tue, 29 Jul 2014)

Log Message

WKPDFView paints rotated pages squished
https://bugs.webkit.org/show_bug.cgi?id=135401
<rdar://problem/17173916>

Reviewed by Simon Fraser.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _computePageAndDocumentFrames]):
[page size] returns the crop box's size, ignoring rotation.
[page cropBoxAccountForRotation] respects rotation, but otherwise returns the same size.
UIPDFPageView will respect rotation when painting, so we
should make sure that it is given an aspect ratio that also
respects rotation, so that the page isn't squished.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171774 => 171775)


--- trunk/Source/WebKit2/ChangeLog	2014-07-29 22:52:39 UTC (rev 171774)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-29 23:01:47 UTC (rev 171775)
@@ -1,3 +1,19 @@
+2014-07-29  Tim Horton  <[email protected]>
+
+        WKPDFView paints rotated pages squished
+        https://bugs.webkit.org/show_bug.cgi?id=135401
+        <rdar://problem/17173916>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView _computePageAndDocumentFrames]):
+        [page size] returns the crop box's size, ignoring rotation.
+        [page cropBoxAccountForRotation] respects rotation, but otherwise returns the same size.
+        UIPDFPageView will respect rotation when painting, so we
+        should make sure that it is given an aspect ratio that also
+        respects rotation, so that the page isn't squished.
+
 2014-07-29  Csaba Osztrogonác  <[email protected]>
 
         URTBF for !ENABLE(DATABASE_PROCESS) platforms.

Modified: trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm (171774 => 171775)


--- trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm	2014-07-29 22:52:39 UTC (rev 171774)
+++ trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm	2014-07-29 23:01:47 UTC (rev 171775)
@@ -239,7 +239,7 @@
         if (!page)
             continue;
 
-        CGSize pageSize = [page size];
+        CGSize pageSize = [page cropBoxAccountForRotation].size;
         pageFrame.size.height = pageSize.height / pageSize.width * pageFrame.size.width;
         CGRect pageFrameWithMarginApplied = CGRectInset(pageFrame, pdfPageMargin, pdfPageMargin);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to