1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Split highlight annotation div into multiple divs

Fix for issue #12504.
Highlight annotation may have several rectangles so we must have several divs to add mouse events handlers.
This commit is contained in:
Calixte Denizet 2020-10-21 13:12:43 +02:00
parent 1eaf9c961b
commit 85e6c67cf3
2 changed files with 75 additions and 18 deletions

View file

@ -2086,6 +2086,13 @@ class PopupAnnotation extends Annotation {
const rawParent = parameters.dict.getRaw("Parent");
this.data.parentId = isRef(rawParent) ? rawParent.toString() : null;
const parentRect = parentItem.getArray("Rect");
if (Array.isArray(parentRect) && parentRect.length === 4) {
this.data.parentRect = Util.normalizeRect(parentRect);
} else {
this.data.parentRect = [0, 0, 0, 0];
}
const rt = parentItem.get("RT");
if (isName(rt, AnnotationReplyType.GROUP)) {
// Subordinate annotations in a group should inherit