diff options
| author | bob <bcz@cs.brown.edu> | 2019-10-03 16:43:39 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-10-03 16:43:39 -0400 |
| commit | 6c56481932872e9a35030cf3e44f1a6f75f88c51 (patch) | |
| tree | 962864e666ff456e5305a79b87b6a93907599873 /src | |
| parent | 2413d93a31ad4c97e09f79b97bc19346e72a1537 (diff) | |
fixed docdecoration scrolling with pdfs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 9ff3e1bd1..1b76ddbdc 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -331,8 +331,10 @@ export class PDFViewer extends React.Component<IViewerProps> { } } + @observable scrollTop = 0; @action onScroll = (e: React.UIEvent<HTMLElement>) => { + this.scrollTop = this._mainCont.current!.scrollTop; this.pdfViewer && (this.props.Document.curPage = this.pdfViewer.currentPageNumber); } @@ -607,7 +609,7 @@ export class PDFViewer extends React.Component<IViewerProps> { return true; } scrollXf = () => { - return this._mainCont.current ? this.props.ScreenToLocalTransform().translate(0, this._mainCont.current.scrollTop) : this.props.ScreenToLocalTransform(); + return this._mainCont.current ? this.props.ScreenToLocalTransform().translate(0, this.scrollTop) : this.props.ScreenToLocalTransform(); } setPreviewCursor = (func?: (x: number, y: number, drag: boolean) => void) => { this._setPreviewCursor = func; |
