Fix named destination "FitR" zooming in at the wrong region issue.
In the PDF viewer, the viewport uses goToPageAndXY() to navigate inside the document, which takes in-screen coordinates as x and y input. The parameters we get from FPDFDest_GetVieware() are directly from the named destination, which uses the in-page coordinates. However, these in-page coordinates are sent to the viewport for navigation without getting transformed into in-screen coordinates, which results in PDF viewer zooming in at the wrong region of the page for FitR type named destination. Since coordinate transformation is missing for all view fit types, this CL adds a helper ParamsTransformPageToScreen() to handle the transformation according to the view's fit type. (See Table 151 about Destination syntax from PDF 32000-1:2008.) Bug: 1136733 Change-Id: I811844260f2ea9b1a5244a178174691e85f2f96d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628492Reviewed-by:dsinclair <dsinclair@chromium.org> Commit-Queue: Hui Yingst <nigi@chromium.org> Cr-Commit-Position: refs/heads/master@{#843710}
Showing
Please register or sign in to comment