aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-04-25 17:15:20 -0400
committerbobzel <zzzman@gmail.com>2024-04-25 17:15:20 -0400
commitd6720fa48d78cc313d6418acd8cbdaeda965285c (patch)
treed9cec7f7b031b20bfc5423bc48f8791074b2d5c1 /src/client/views/pdf/PDFViewer.tsx
parentbd3b34cce2ad85bfc96c16304b532d1510fd359e (diff)
changed marqueeAnnotator to save inline annotations as text strings instead of Docs. enabled making image crops of text selections on PDFs. cleaned up webboxrendered lint promses, and Annotation render
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index a3fd192f7..22355bc57 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -388,7 +388,6 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> {
if (!e.altKey && e.button === 0 && this._props.isContentActive() && ![InkTool.Highlighter, InkTool.Pen, InkTool.Write].includes(Doc.ActiveTool)) {
this._props.select(false);
MarqueeAnnotator.clearAnnotations(this._savedAnnotations);
- this._marqueeref.current?.onInitiateSelection([e.clientX, e.clientY]);
this.isAnnotating = true;
const target = e.target as any;
if (e.target && (target.className.includes('endOfContent') || (target.parentElement.className !== 'textLayer' && target.parentElement.parentElement?.className !== 'textLayer'))) {
@@ -400,6 +399,7 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> {
this._styleRule = addStyleSheetRule(PDFViewer._annotationStyle, 'htmlAnnotation', { 'pointer-events': 'none' });
document.addEventListener('pointerup', this.onSelectEnd);
}
+ this._marqueeref.current?.onInitiateSelection([e.clientX, e.clientY]);
}
};
@@ -505,7 +505,7 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> {
<div className="pdfViewerDash-annotationLayer" style={{ height: Doc.NativeHeight(this._props.Document), transform: `scale(${NumCast(this._props.layoutDoc._freeform_scale, 1)})` }} ref={this._annotationLayer}>
{inlineAnnos.map(anno => (
// eslint-disable-next-line react/jsx-props-no-spreading
- <Annotation {...this._props} fieldKey={this._props.fieldKey + '_annotations'} pointerEvents={this.pointerEvents} dataDoc={this._props.dataDoc} anno={anno} key={`${anno[Id]}-annotation`} />
+ <Annotation {...this._props} fieldKey={this._props.fieldKey + '_annotations'} pointerEvents={this.pointerEvents} containerDataDoc={this._props.dataDoc} annoDoc={anno} key={`${anno[Id]}-annotation`} />
))}
</div>
);
@@ -615,7 +615,7 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> {
selectionText={this.selectionText}
annotationLayer={this._annotationLayer.current}
marqueeContainer={this._mainCont.current}
- anchorMenuCrop={this._textSelecting ? undefined : this.crop}
+ anchorMenuCrop={this.crop}
/>
)}
</div>