1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

[Editor] Fix dimensions of a rotated FreeText after a dimensions change

This commit is contained in:
Calixte Denizet 2023-07-04 23:56:24 +02:00
parent 8b50836d76
commit 1ce6668a70
2 changed files with 93 additions and 2 deletions

View file

@ -342,8 +342,15 @@ class FreeTextEditor extends AnnotationEditor {
div.style.display = savedDisplay;
}
this.width = rect.width / parentWidth;
this.height = rect.height / parentHeight;
// The dimensions are relative to the rotation of the page, hence we need to
// take that into account (see issue #16636).
if (this.rotation % 180 === this.parentRotation % 180) {
this.width = rect.width / parentWidth;
this.height = rect.height / parentHeight;
} else {
this.width = rect.height / parentWidth;
this.height = rect.width / parentHeight;
}
}
/**