From f13bbca9c3911e7339f3f62f359b26f559d6cc6b Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 12 Apr 2018 14:25:46 +0100 Subject: [PATCH] Fix getWorldBounds clash --- src/gameobjects/components/GetBounds.js | 2 +- src/gameobjects/components/Transform.js | 2 +- src/gameobjects/container/Container.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gameobjects/components/GetBounds.js b/src/gameobjects/components/GetBounds.js index f22cf0866..126342343 100644 --- a/src/gameobjects/components/GetBounds.js +++ b/src/gameobjects/components/GetBounds.js @@ -178,7 +178,7 @@ var GetBounds = { // defined per corner we only do it once. if (this.parentContainer) { - var parentMatrix = this.parentContainer.getWorldTransformMatrix(); + var parentMatrix = this.parentContainer.getBoundsTransformMatrix(); this.getTopLeft(output); parentMatrix.transformPoint(output.x, output.y, output); diff --git a/src/gameobjects/components/Transform.js b/src/gameobjects/components/Transform.js index b725b9d6c..7f64ffb8a 100644 --- a/src/gameobjects/components/Transform.js +++ b/src/gameobjects/components/Transform.js @@ -406,7 +406,7 @@ var Transform = { if (!parent) { - return tempMatrix(); + return this.getLocalTransformMatrix(tempMatrix); } var parents = []; diff --git a/src/gameobjects/container/Container.js b/src/gameobjects/container/Container.js index d78605c11..7bd14c883 100644 --- a/src/gameobjects/container/Container.js +++ b/src/gameobjects/container/Container.js @@ -407,15 +407,15 @@ var Container = new Class({ }, /** - * Returns the world transform matrix. + * Returns the world transform matrix as used for Bounds checks. * The returned matrix is a temporal and shouldn't be stored. * - * @method Phaser.GameObjects.Container#getWorldTransformMatrix + * @method Phaser.GameObjects.Container#getBoundsTransformMatrix * @since 3.4.0 * * @return {Phaser.GameObjects.Components.TransformMatrix} The world transform matrix. */ - getWorldTransformMatrix: function () + getBoundsTransformMatrix: function () { var tempMatrix = this.tempTransformMatrix;