Skip to content

Commit

Permalink
Fix for Camera to handle leaving scene while tweening.
Browse files Browse the repository at this point in the history
  • Loading branch information
probityrules committed May 17, 2023
1 parent a95501b commit 1b2ebea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
},
Expand Down

0 comments on commit 1b2ebea

Please sign in to comment.