aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2021-07-31 00:28:06 -0400
committergeireann <geireann.lindfield@gmail.com>2021-07-31 00:28:06 -0400
commitfc10b0e4be1f10864dc2f38b40c20e3e82ba54d0 (patch)
tree22db1339070014311f08f1aaf2494ce7ddb10b1b /src/client/views/pdf/PDFViewer.tsx
parentb44c8e15662b26a1f848fd241a4e13ef4312c877 (diff)
parentb6b2057cf28e8c0d3c22b9056074fe5155602d0a (diff)
Merge branch 'master' into tab_updates
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx3
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;