Skip to content

Commit 8567188

Browse files
committed
Tidying up
1 parent 34b236d commit 8567188

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/gameobjects/container/Container.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ var Container = new Class({
6262
*/
6363
this.children = [];
6464

65-
this.setPosition(x, y);
66-
6765
/**
6866
* [description]
6967
*
@@ -81,6 +79,8 @@ var Container = new Class({
8179
* @since 3.4.0
8280
*/
8381
this.tempTransformMatrix = new Components.TransformMatrix();
82+
83+
this.setPosition(x, y);
8484
},
8585

8686
/**
@@ -163,14 +163,16 @@ var Container = new Class({
163163

164164
if (this.parentContainer)
165165
{
166-
this.parentContainer.pointToContainer(source, output);
166+
return this.parentContainer.pointToContainer(source, output);
167167
}
168168

169169
var tempMatrix = this.tempTransformMatrix;
170170

171-
tempMatrix.loadIdentity();
171+
// No need to loadIdentity because applyITRS overwrites every value anyway
172172
tempMatrix.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY);
173+
173174
tempMatrix.invert();
175+
174176
tempMatrix.transformPoint(source.x, source.y, output);
175177

176178
return output;

0 commit comments

Comments
 (0)