box-annotations 4.1.1-beta.1 → 4.1.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotations.js +1 -1
- package/package.json +1 -1
- package/src/document/docUtil.ts +4 -0
package/package.json
CHANGED
package/src/document/docUtil.ts
CHANGED
|
@@ -39,6 +39,10 @@ export function getSelection(): Selection | null {
|
|
|
39
39
|
// We only care about the last range
|
|
40
40
|
let range = selection.getRangeAt(selection.rangeCount - 1);
|
|
41
41
|
|
|
42
|
+
// Changes to the text layer in PDFjs v2.14.305 require the start range to be set manually for correct highlighting behavior
|
|
43
|
+
const startRange = selection.getRangeAt(0);
|
|
44
|
+
range.setStart(startRange.startContainer, startRange.startOffset);
|
|
45
|
+
|
|
42
46
|
const containerEl = findClosestElWithClass(range.endContainer as Element, 'textLayer');
|
|
43
47
|
const startPage = getPageNumber(range.startContainer as Element);
|
|
44
48
|
const endPage = getPageNumber(range.endContainer as Element);
|