diff options
author | bobzel <zzzman@gmail.com> | 2021-07-29 17:49:14 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-07-29 17:49:14 -0400 |
commit | a5faca5f510e60ecce125ab59096d4e943352ea5 (patch) | |
tree | 11af63d101118e134f7e0438dbbf05ef515dbf39 /src/client/views/pdf/PDFViewer.tsx | |
parent | 93c06962c18c916518616ab8f53944487e59fc2a (diff) |
fixed issues with following links to anchors in PDFs/etc and getting scroll position right.
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 4a50dccf3..e8c7a4ab0 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -184,7 +184,8 @@ export class PDFViewer extends React.Component<IViewerProps> { const mainCont = this._mainCont.current; let focusSpeed: Opt<number>; if (doc !== this.props.rootDoc && mainCont && this._pdfViewer) { - const scrollTo = Utils.scrollIntoView(NumCast(doc.y), doc[HeightSym](), NumCast(this.props.layoutDoc._scrollTop), this.props.PanelHeight() / (this.props.scaling?.() || 1)); + const windowHeight = this.props.PanelHeight() / (this.props.scaling?.() || 1); + const scrollTo = Utils.scrollIntoView(NumCast(doc.y), doc[HeightSym](), NumCast(this.props.layoutDoc._scrollTop), windowHeight, .1 * windowHeight); if (scrollTo !== undefined) { focusSpeed = 500; |