mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Set rotated free highlight at the right position after having changed its thickness (bug 1879108)
This commit is contained in:
parent
5cfaff508c
commit
de1985abbb
3 changed files with 112 additions and 1 deletions
|
@ -184,7 +184,6 @@ class DrawLayer {
|
|||
const root = this.#mapping.get(id);
|
||||
const defs = root.firstChild;
|
||||
const path = defs.firstChild;
|
||||
this.updateBox(id, line.box);
|
||||
path.setAttribute("d", line.toSVGPath());
|
||||
}
|
||||
|
||||
|
|
|
@ -135,8 +135,21 @@ class HighlightEditor extends AnnotationEditor {
|
|||
this.#focusOutlines
|
||||
);
|
||||
} else if (this.parent) {
|
||||
const angle = this.parent.viewport.rotation;
|
||||
this.parent.drawLayer.updateLine(this.#id, highlightOutlines);
|
||||
this.parent.drawLayer.updateBox(
|
||||
this.#id,
|
||||
HighlightEditor.#rotateBbox(
|
||||
this.#highlightOutlines.box,
|
||||
(angle - this.rotation + 360) % 360
|
||||
)
|
||||
);
|
||||
|
||||
this.parent.drawLayer.updateLine(this.#outlineId, this.#focusOutlines);
|
||||
this.parent.drawLayer.updateBox(
|
||||
this.#outlineId,
|
||||
HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle)
|
||||
);
|
||||
}
|
||||
const { x, y, width, height } = highlightOutlines.box;
|
||||
switch (this.rotation) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue