From: timothy_horton@apple.com Date: Tue, 29 Jul 2014 23:01:47 +0000 (+0000) Subject: WKPDFView paints rotated pages squished X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=6ca241edd42189f72eb16c83f8534a27fdbf4c49 WKPDFView paints rotated pages squished https://bugs.webkit.org/show_bug.cgi?id=135401 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 --- diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index b2fb67271954..bb2402f84029 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,19 @@ +2014-07-29 Tim Horton + + WKPDFView paints rotated pages squished + https://bugs.webkit.org/show_bug.cgi?id=135401 + + + 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 URTBF for !ENABLE(DATABASE_PROCESS) platforms. diff --git a/Source/WebKit2/UIProcess/ios/WKPDFView.mm b/Source/WebKit2/UIProcess/ios/WKPDFView.mm index 746fbccda0a9..dc144f9e24de 100644 --- a/Source/WebKit2/UIProcess/ios/WKPDFView.mm +++ b/Source/WebKit2/UIProcess/ios/WKPDFView.mm @@ -239,7 +239,7 @@ typedef struct { 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);