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:
commit
657edb3892
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue