Merge pull request #1090 from Blank101/swapfix

Group.swap() fix
This commit is contained in:
Richard Davey 2014-08-06 16:10:18 +01:00
commit b3d08ea535

View file

@ -449,7 +449,7 @@ Phaser.Group.prototype.previous = function () {
/**
* Swaps the position of two children in this Group. Both children must be in this Group.
* You cannot swap a child with itself, or swap un-parented children, doing so will return false.
* You cannot swap a child with itself, or swap un-parented children.
*
* @method Phaser.Group#swap
* @param {*} child1 - The first child to swap.
@ -457,14 +457,8 @@ Phaser.Group.prototype.previous = function () {
*/
Phaser.Group.prototype.swap = function (child1, child2) {
var result = this.swapChildren(child1, child2);
if (result)
{
this.updateZ();
}
return result;
this.swapChildren(child1, child2);
this.updateZ();
};