mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
Merge pull request #6021 from overleaf/ae-pdf-preview-horizontal-scroll
[web] Store left offset of PDF position GitOrigin-RevId: 77d6b52a8485a427bb59618bf42b5f4a300c260a
This commit is contained in:
@@ -150,12 +150,13 @@ export default class PDFJSWrapper {
|
||||
|
||||
const containerRect = this.container.getBoundingClientRect()
|
||||
const dy = containerRect.top - pageRect.top
|
||||
const dx = containerRect.left - pageRect.left
|
||||
const [left, top] = pageView.viewport.convertToPdfPoint(dx, dy)
|
||||
const [, , width, height] = pageView.viewport.viewBox
|
||||
const [, top] = pageView.viewport.convertToPdfPoint(0, dy)
|
||||
|
||||
return {
|
||||
page: pageIndex,
|
||||
offset: { top, left: 0 },
|
||||
offset: { top, left },
|
||||
pageSize: { height, width },
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user