Add handling for two-up view to PDFiumEngine::GetPageScreenRect().
Currently PDFiumEngine::GetPageScreenRect() calculates the area of the |page_index| page, including the area around it such as shadows and separators. In two-up view, when two pages are side-by-side and one page is shorter than the other, the space below the shorter page must be drawn as empty space to match the height of the taller page. This CL refactors PDFiumEngine::GetPageScreenRect() so that when |two_up_view_| is true, it calls draw_utils::GetSurroundingRect() with a copy of the rect for |page_index| page with its height set to the max height of the two pages. It also adds PDFiumEngine::GetAdjacentPageIndexForTwoUpView() which retrieves the index of the page adjacent to the current page. Bug: 51472 Change-Id: I869903f869e926117cd60beb92db0ce96606579a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715116 Commit-Queue: Jeremy Chinsen <chinsenj@google.com> Reviewed-by:Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#680271}
Showing
Please register or sign in to comment