aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PDFBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-01-20 13:50:20 -0500
committerbobzel <zzzman@gmail.com>2023-01-20 13:50:20 -0500
commite52370d43c6f9f5edfa01c6a8e3e93895cc9f778 (patch)
treebfe6d578c24cab71e3da27684df9efdc31c34e66 /src/client/views/nodes/PDFBox.tsx
parent84f728cffb94319b86be8d6cc478ce424ec45c2f (diff)
went back to adding PDF text selection targets as annotations when anchor of pres element a
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r--src/client/views/nodes/PDFBox.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 71ef9bc84..b88ac113e 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -226,10 +226,11 @@ export class PDFBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
PresBox.pinDocView(anchor, { pinData: { scrollable: true, pannable: true } }, this.rootDoc);
return anchor;
};
- const anchor = this._pdfViewer?._getAnchor(this._pdfViewer.savedAnnotations(), false) ?? docAnchor();
+ const annoAnchor = this._pdfViewer?._getAnchor(this._pdfViewer.savedAnnotations(), true);
+ const anchor = annoAnchor ?? docAnchor();
anchor.text = ele?.textContent ?? '';
anchor.textHtml = ele?.innerHTML;
- if (addAsAnnotation) {
+ if (addAsAnnotation || annoAnchor) {
this.addDocument(anchor);
}
return anchor;