Fix scrolling to annotations in un-rendered pages
When scrolling to an anchor in a page that has not been rendered by PDF.js, the anchor actually references a placeholder element in the middle of the page. In order to scroll to the correct location in the page scrolling for such anchors needs to happen in three phases: 1. Scroll to the approximate location of the final anchor, given by the placeholder anchor. This will trigger PDF.js to re-render the target page. 2. Wait for PDF.js to finish re-rendering the page and for the client to finish re-anchoring the annotation. 3. Scroll to the real/non-placeholder anchor. Change `PDFIntegration#scrollToAnchor` to implement the above steps. Fixes https://github.com/hypothesis/client/issues/3269
Showing
Please register or sign in to comment