From 1b2ebeaba225facb89632f804c4c14a5f120aed2 Mon Sep 17 00:00:00 2001 From: Derek Detweiler Date: Wed, 17 May 2023 13:14:50 -0400 Subject: [PATCH] Fix for Camera to handle leaving scene while tweening. --- src/components/Camera.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Camera.js b/src/components/Camera.js index a0ded7e7..da25ebff 100644 --- a/src/components/Camera.js +++ b/src/components/Camera.js @@ -464,7 +464,9 @@ export default (function () { tween.easing(ease); } tween.onUpdate(() => { - this.resize(); + if (!this.owner.destroyed) { + this.resize(); + } }).start(); } else { if (width && height) { @@ -502,7 +504,7 @@ export default (function () { */ "relocate": (function () { var move = function (v) { - if (this.move(v.x, v.y)) { + if (!this.owner.destroyed && this.move(v.x, v.y)) { this.viewportUpdate = true; } },