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
@ -578,7 +578,10 @@ class InkEditor extends AnnotationEditor {
|
|||||||
|
|
||||||
this.canvas.style.visibility = "hidden";
|
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);
|
height = Math.ceil(width / this.#aspectRatio);
|
||||||
this.setDims(width, height);
|
this.setDims(width, height);
|
||||||
}
|
}
|
||||||
@ -846,6 +849,9 @@ class InkEditor extends AnnotationEditor {
|
|||||||
this.#setCanvasDims();
|
this.#setCanvasDims();
|
||||||
this.#redraw();
|
this.#redraw();
|
||||||
|
|
||||||
|
this.#realWidth = width;
|
||||||
|
this.#realHeight = height;
|
||||||
|
|
||||||
this.setDims(width, height);
|
this.setDims(width, height);
|
||||||
this.translate(
|
this.translate(
|
||||||
prevTranslationX - this.translationX,
|
prevTranslationX - this.translationX,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user