fixed bug where addChildAt, not actually adding the child
This commit is contained in:
parent
1bc122aa05
commit
6d7f206a2b
2 changed files with 16 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue