From 6d7f206a2b816fe97b53b7a9686ac8665a4f60c6 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Tue, 31 Dec 2013 19:16:50 +0000 Subject: [PATCH] fixed bug where addChildAt, not actually adding the child --- bin/pixi.dev.js | 9 ++++++++- src/pixi/display/DisplayObjectContainer.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index 0205fe9..8fad6da 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -1155,6 +1155,8 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; * @property width * @type Number */ + +/* Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { get: function() { return this.scale.x * this.getBounds().width; @@ -1164,13 +1166,15 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { this._width = value; } }); - +*/ /** * The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set * * @property height * @type Number */ + + /* Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { get: function() { return this.scale.y * this.getBounds().height; @@ -1180,6 +1184,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { this._height = value; } }); +*/ /** * Adds a child to the container. @@ -1224,6 +1229,8 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) child.parent = this; + this.children.splice(index, 0, child); + if(this.stage)this.setStageReference(this.stage) } else diff --git a/src/pixi/display/DisplayObjectContainer.js b/src/pixi/display/DisplayObjectContainer.js index 4916aab..117b572 100644 --- a/src/pixi/display/DisplayObjectContainer.js +++ b/src/pixi/display/DisplayObjectContainer.js @@ -35,6 +35,8 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; * @property width * @type Number */ + +/* Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { get: function() { return this.scale.x * this.getBounds().width; @@ -44,13 +46,15 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { this._width = value; } }); - +*/ /** * The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set * * @property height * @type Number */ + + /* Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { get: function() { return this.scale.y * this.getBounds().height; @@ -60,6 +64,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { this._height = value; } }); +*/ /** * Adds a child to the container. @@ -104,6 +109,8 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) child.parent = this; + this.children.splice(index, 0, child); + if(this.stage)this.setStageReference(this.stage) } else