fixed bug where addChildAt, not actually adding the child

This commit is contained in:
Mat Groves 2013-12-31 19:16:50 +00:00
parent 1bc122aa05
commit 6d7f206a2b
2 changed files with 16 additions and 2 deletions

View file

@ -1155,6 +1155,8 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
* @property width * @property width
* @type Number * @type Number
*/ */
/*
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
get: function() { get: function() {
return this.scale.x * this.getBounds().width; return this.scale.x * this.getBounds().width;
@ -1164,13 +1166,15 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
this._width = value; this._width = value;
} }
}); });
*/
/** /**
* The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set * The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
* *
* @property height * @property height
* @type Number * @type Number
*/ */
/*
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
get: function() { get: function() {
return this.scale.y * this.getBounds().height; return this.scale.y * this.getBounds().height;
@ -1180,6 +1184,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
this._height = value; this._height = value;
} }
}); });
*/
/** /**
* Adds a child to the container. * Adds a child to the container.
@ -1224,6 +1229,8 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
child.parent = this; child.parent = this;
this.children.splice(index, 0, child);
if(this.stage)this.setStageReference(this.stage) if(this.stage)this.setStageReference(this.stage)
} }
else else

View file

@ -35,6 +35,8 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
* @property width * @property width
* @type Number * @type Number
*/ */
/*
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
get: function() { get: function() {
return this.scale.x * this.getBounds().width; return this.scale.x * this.getBounds().width;
@ -44,13 +46,15 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
this._width = value; this._width = value;
} }
}); });
*/
/** /**
* The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set * The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
* *
* @property height * @property height
* @type Number * @type Number
*/ */
/*
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
get: function() { get: function() {
return this.scale.y * this.getBounds().height; return this.scale.y * this.getBounds().height;
@ -60,6 +64,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
this._height = value; this._height = value;
} }
}); });
*/
/** /**
* Adds a child to the container. * Adds a child to the container.
@ -104,6 +109,8 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
child.parent = this; child.parent = this;
this.children.splice(index, 0, child);
if(this.stage)this.setStageReference(this.stage) if(this.stage)this.setStageReference(this.stage)
} }
else else