From c015dc3b76ec30e9d7057ee558787e59033af270 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 3 Mar 2022 18:37:30 -0500 Subject: fixed pdf rendering and interaction --- src/client/views/pdf/PDFViewer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/client/views/pdf') diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index de23ac74d..e11792dc8 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -33,7 +33,7 @@ const _global = (window /* browser */ || global /* node */) as any; //pdfjsLib.GlobalWorkerOptions.workerSrc = `/assets/pdf.worker.js`; // The workerSrc property shall be specified. -pdfjsLib.GlobalWorkerOptions.workerSrc = "https://unpkg.com/pdfjs-dist@2.4.456/build/pdf.worker.min.js"; +pdfjsLib.GlobalWorkerOptions.workerSrc = "https://unpkg.com/pdfjs-dist@2.13.216/build/pdf.worker.js"; interface IViewerProps extends FieldViewProps { Document: Doc; @@ -218,7 +218,7 @@ export class PDFViewer extends React.Component { } pagesinit = () => { - if (this._pdfViewer._setDocumentViewerElement.offsetParent) { + if (this._pdfViewer._setDocumentViewerElement?.offsetParent) { runInAction(() => this._pdfViewer.currentScaleValue = this._zoomed = 1); this.gotoPage(NumCast(this.props.Document._curPage, 1)); } @@ -473,7 +473,7 @@ export class PDFViewer extends React.Component { @action onZoomWheel = (e: React.WheelEvent) => { - if (this.props.isContentActive(true)) { + if (this.props.isSelected(false) || this.props.isContentActive(true)) { e.stopPropagation(); if (e.ctrlKey) { const curScale = Number(this._pdfViewer.currentScaleValue); -- cgit v1.2.3-70-g09d2