mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Fix wrong Container.getBounds with child container
This commit is contained in:
parent
88b088b6a2
commit
f4ba7c4e3a
1 changed files with 9 additions and 1 deletions
|
@ -384,12 +384,20 @@ var Container = new Class({
|
|||
|
||||
output.setTo(this.x, this.y, 0, 0);
|
||||
|
||||
if (this.parentContainer) {
|
||||
var parentMatrix = this.parentContainer.getBoundsTransformMatrix();
|
||||
var transformedPosition = parentMatrix.transformPoint(this.x, this.y);
|
||||
output.setTo(transformedPosition.x, transformedPosition.y, 0, 0);
|
||||
}
|
||||
|
||||
if (this.list.length > 0)
|
||||
{
|
||||
var children = this.list;
|
||||
var tempRect = new Rectangle();
|
||||
|
||||
for (var i = 0; i < children.length; i++)
|
||||
var firstChildBounds = children[0].getBounds();
|
||||
output.setTo(firstChildBounds.x, firstChildBounds.y, firstChildBounds.width, firstChildBounds.height);
|
||||
for (var i = 1; i < children.length; i++)
|
||||
{
|
||||
var entry = children[i];
|
||||
|
||||
|
|
Loading…
Reference in a new issue