aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PDFBox.tsx
diff options
context:
space:
mode:
authorMohammad Amoush <mohammad_amoush@brown.edu>2019-07-29 19:45:25 -0400
committerMohammad Amoush <mohammad_amoush@brown.edu>2019-07-29 19:45:25 -0400
commit41583609724911182f2c16b06e61bee6a779bb34 (patch)
treeff32273d40d832edd24385b4ea7a7b95ef311f21 /src/client/views/nodes/PDFBox.tsx
parent215b73fbcfe0d6f205668e1bb7c755228e858ac9 (diff)
parentd7af2cae3ec66ca9a8c9abbc0a221ee1dbb6d101 (diff)
Merge master, quick opacity changes
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r--src/client/views/nodes/PDFBox.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 5a5e6e6dd..fa072aecf 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -24,6 +24,8 @@ import { Flyout, anchorPoints } from '../DocumentDecorations';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { ScriptField } from '../../../new_fields/ScriptField';
import { KeyCodes } from '../../northstar/utils/KeyCodes';
+import { Utils } from '../../../Utils';
+import { Id } from '../../../new_fields/FieldSymbols';
type PdfDocument = makeInterface<[typeof positionSchema, typeof pageSchema]>;
const PdfDocument = makeInterface(positionSchema, pageSchema);
@@ -151,7 +153,7 @@ export class PDFBox extends DocComponent<FieldViewProps, PdfDocument>(PdfDocumen
scrollTo(y: number) {
if (this._mainCont.current) {
- this._mainCont.current.scrollTo({ top: y, behavior: "auto" });
+ this._mainCont.current.scrollTo({ top: Math.max(y - (this._mainCont.current!.offsetHeight / 2), 0), behavior: "auto" });
}
}