diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-06-16 21:39:48 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-06-16 21:39:48 -0400 |
commit | ee1e6f815b76f9c0e076c8fecc89dd4fa1f5cf4b (patch) | |
tree | 882e84f643b49dbf677d5ff5aff5c4d1ee4048e5 /src | |
parent | e1f88e962cce91d9bcd6900163756934bc5a09a8 (diff) |
fixed access out-of-bounds error.. fixed event handling for unselected pdf.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/PDFBox.scss | 21 | ||||
-rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 2 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/client/views/nodes/PDFBox.scss b/src/client/views/nodes/PDFBox.scss index bb1f534c6..8bcae4f1e 100644 --- a/src/client/views/nodes/PDFBox.scss +++ b/src/client/views/nodes/PDFBox.scss @@ -36,15 +36,14 @@ pointer-events: none; display: flex; flex-direction: row; - - span { - pointer-events: none !important; + .textlayer { + pointer-events: none; + span { + pointer-events: none !important; + } } -} -.textlayer { - span { - pointer-events: all !important; - user-select: text; + .page-cont { + pointer-events: none; } } @@ -52,6 +51,12 @@ pointer-events: all; display: flex; flex-direction: row; + .textlayer { + span { + pointer-events: all !important; + user-select: text; + } + } } .pdfBox-contentContainer { diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 75c298f55..bc7cfecbb 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -392,7 +392,7 @@ class Viewer extends React.Component<IViewerProps> { let index = 0; let currOffset = vOffset; while (index < numPages && currOffset - (this._pageSizes[index] ? this._pageSizes[index].height : 792 * scale) > 0) { - currOffset -= this._pageSizes[index].height; + currOffset -= this._pageSizes[index] ? this._pageSizes[index].height : this._pageSizes[0].height; index++; } return index; |