From 9cdada00304d3155bb64f50c2c42ecdf030b1968 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Sun, 20 Feb 2022 17:55:52 -0600 Subject: [PATCH] Fix too much recursion when using dynamically resized stage --- src/scaffolding/scaffolding.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scaffolding/scaffolding.js b/src/scaffolding/scaffolding.js index a774dbd2..7addf4b4 100644 --- a/src/scaffolding/scaffolding.js +++ b/src/scaffolding/scaffolding.js @@ -324,9 +324,11 @@ class Scaffolding extends EventTarget { } // TODO: remove when https://github.com/TurboWarp/packager/issues/213 is fixed this.vm.on('STAGE_SIZE_CHANGED', (width, height) => { - this.width = width; - this.height = height; - this.relayout(); + if (this.width !== width || this.height !== height) { + this.width = width; + this.height = height; + this.relayout(); + } }); this.cloudManager = new Cloud.CloudManager(this);