diff options
| author | dinhanhtruong <70963346+dinhanhtruong@users.noreply.github.com> | 2021-08-30 22:37:59 -0400 |
|---|---|---|
| committer | dinhanhtruong <70963346+dinhanhtruong@users.noreply.github.com> | 2021-08-30 22:37:59 -0400 |
| commit | 26e265c6fc4950b859724aa2c0fbe6a028a56bfc (patch) | |
| tree | f8171faa668cc311cd3010e491e291ecc6be460b /src/client/views/pdf/PDFViewer.tsx | |
| parent | 2df1a0c0cc11c0dbcebf2a53e804cf8ac28db346 (diff) | |
| parent | 2d2e027f11253834a337680bbfd1ac549bb2a1f0 (diff) | |
Merge branch 'master' into linking-anh
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 734d9127c..02010e123 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -119,9 +119,11 @@ export class PDFViewer extends React.Component<IViewerProps> { this._mainCont.current?.addEventListener("scroll", e => (e.target as any).scrollLeft = 0); this._disposers.autoHeight = reaction(() => this.props.layoutDoc._autoHeight, - () => { - this.props.layoutDoc._nativeHeight = NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]); - this.props.setHeight(NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]) * (this.props.scaling?.() || 1)); + autoHeight => { + if (autoHeight) { + this.props.layoutDoc._nativeHeight = NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]); + this.props.setHeight(NumCast(this.props.Document[this.props.fieldKey + "-nativeHeight"]) * (this.props.scaling?.() || 1)); + } }); this._disposers.searchMatch = reaction(() => Doc.IsSearchMatch(this.props.rootDoc), @@ -512,7 +514,6 @@ export class PDFViewer extends React.Component<IViewerProps> { const renderAnnotations = (docFilters?: () => string[]) => <CollectionFreeFormView {...OmitKeys(this.props, ["NativeWidth", "NativeHeight", "setContentView"]).omit} isAnnotationOverlay={true} - isContentActive={returnFalse} fieldKey={this.props.fieldKey + "-annotations"} setPreviewCursor={this.setPreviewCursor} PanelHeight={this.panelHeight} @@ -526,7 +527,7 @@ export class PDFViewer extends React.Component<IViewerProps> { CollectionView={undefined} ScreenToLocalTransform={this.overlayTransform} renderDepth={this.props.renderDepth + 1} - childPointerEvents={true} /> + childPointerEvents={true} />; return <div> <div className={`pdfViewerDash-overlay${CurrentUserUtils.SelectedTool !== InkTool.None || SnappingManager.GetIsDragging() ? "-inking" : ""}`} style={{ @@ -543,7 +544,7 @@ export class PDFViewer extends React.Component<IViewerProps> { transform: `scale(${this._zoomed})` }}> {renderAnnotations(this.opaqueFilter)} - {renderAnnotations()} + {SnappingManager.GetIsDragging() ? (null) : renderAnnotations()} </div> </div>; } |
