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

Merge pull request #15147 from calixteman/editor_size

[Editor] Avoid to resize and redraw the ink canvas when it's useless
This commit is contained in:
calixteman 2022-07-07 19:49:59 +02:00 committed by GitHub
commit 657edb3892
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -578,7 +578,10 @@ class InkEditor extends AnnotationEditor {
this.canvas.style.visibility = "hidden";
if (this.#aspectRatio) {
if (
this.#aspectRatio &&
Math.abs(this.#aspectRatio - width / height) > 1e-2
) {
height = Math.ceil(width / this.#aspectRatio);
this.setDims(width, height);
}
@ -846,6 +849,9 @@ class InkEditor extends AnnotationEditor {
this.#setCanvasDims();
this.#redraw();
this.#realWidth = width;
this.#realHeight = height;
this.setDims(width, height);
this.translate(
prevTranslationX - this.translationX,