diff options
| author | bob <bcz@cs.brown.edu> | 2019-07-17 12:49:15 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-07-17 12:49:15 -0400 |
| commit | 0620688e08a771b0b5b8e00bdf606e3d17c801a5 (patch) | |
| tree | 9df8991c7ddcb9475d3ffcb5f65542b11ad4e413 /src/client/views/pdf | |
| parent | de6e2427cf5eed2805432a37b5284a4c8b934e62 (diff) | |
| parent | 9a4b4e9367d9d1fd245450db62124f0e530e4175 (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/pdf')
| -rw-r--r-- | src/client/views/pdf/Annotation.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx index 104241237..ed7081b1d 100644 --- a/src/client/views/pdf/Annotation.tsx +++ b/src/client/views/pdf/Annotation.tsx @@ -75,7 +75,7 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> { () => this.props.parent.Index, () => { if (this.props.parent.Index === this.props.index) { - this.props.parent.scrollTo(this.props.y * scale - (NumCast(this.props.parent.props.parent.Document.pdfHeight) / 2)); + this.props.parent.scrollTo(this.props.y * scale); } } ); diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 1e29863d9..699a1ffd7 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -192,7 +192,9 @@ export class Viewer extends React.Component<IViewerProps> { } scrollTo(y: number) { - this.props.parent.scrollTo(y); + if (this.props.mainCont.current) { + this.props.parent.scrollTo(y - this.props.mainCont.current.clientHeight); + } } @action |
