diff options
| author | vkalev <vjk1883@gmail.com> | 2021-07-31 15:37:52 -0400 |
|---|---|---|
| committer | vkalev <vjk1883@gmail.com> | 2021-07-31 15:37:52 -0400 |
| commit | 193b90b9ade89b2060c701009ba6e57daf0c8c53 (patch) | |
| tree | c8d05d1161cf5bf9869af6a0d6cd464d52303f4c /src/client/views/pdf/PDFViewer.tsx | |
| parent | 09e5f2c58ca87ded318627cbc5dea436989fcff2 (diff) | |
| parent | 970ea305fde86c6d33fc08c8880ef258b7b318bc (diff) | |
Merge branch 'master' into ink-gfx-victor
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; |
