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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171775
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-07-29 Tim Horton <timothy_horton@apple.com>
+
+ 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 <ossy@webkit.org>
URTBF for !ENABLE(DATABASE_PROCESS) platforms.
2014-07-29 Csaba Osztrogonác <ossy@webkit.org>
URTBF for !ENABLE(DATABASE_PROCESS) platforms.
- 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);
pageFrame.size.height = pageSize.height / pageSize.width * pageFrame.size.width;
CGRect pageFrameWithMarginApplied = CGRectInset(pageFrame, pdfPageMargin, pdfPageMargin);