mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
[Editor] Try to make the position of an edited FreeText the more accurated as possible
- Take into account the page translation, - Take into account the correct translation for the editor border, - Take into account the position of the first glyph in the annotation, - Take into account the rotation of the editor. Close #16633.
This commit is contained in:
parent
35202ec0f3
commit
944c68ee85
11 changed files with 424 additions and 59 deletions
|
@ -304,6 +304,9 @@ class AnnotationElement {
|
|||
}
|
||||
|
||||
setRotation(angle, container = this.container) {
|
||||
if (!this.data.rect) {
|
||||
return;
|
||||
}
|
||||
const { pageWidth, pageHeight } = this.parent.viewport.rawDims;
|
||||
const { width, height } = getRectDims(this.data.rect);
|
||||
|
||||
|
@ -2210,6 +2213,7 @@ class FreeTextAnnotationElement extends AnnotationElement {
|
|||
);
|
||||
super(parameters, { isRenderable, ignoreBorder: true });
|
||||
this.textContent = parameters.data.textContent;
|
||||
this.textPosition = parameters.data.textPosition;
|
||||
this.annotationEditorType = AnnotationEditorType.FREETEXT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue