Currently the calculation for the most visible page in the PDF
viewport and PDFiumEngine compare the first visible page to the page
after it, choosing the page with the highest proportion of its height
that intersects with the viewport. This approach works for single-view,
but not for two-up view, introducing bugs that affect displaying the
page number, traversing the document, and rotating the document.
This CL changes the calculation of the most visible page in
PDFiumEngine and PDF Viewer to return the visible page with the
greatest proportion of its area intersecting with the viewport.
This changes the existing behavior in cases where the most visible
page had the highest proportion of its height intersecting the viewport,
but not area.
Bug: 51472
Change-Id: Ie68c39fbc44543a6a7b6ab023f45c2d5fc74e924
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739599
Commit-Queue: Jeremy Chinsen <chinsenj@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687123}