diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 8002ee4..9830912 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -501,11 +501,7 @@ */ DisplayObject.prototype.destroy = function () { - - this.position = null; - this.scale = null; - this.pivot = null; - this.skew = null; + this.transform = null; this.parent = null; diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 8002ee4..9830912 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -501,11 +501,7 @@ */ DisplayObject.prototype.destroy = function () { - - this.position = null; - this.scale = null; - this.pivot = null; - this.skew = null; + this.transform = null; this.parent = null; diff --git a/test/unit/core/display/Container.test.js b/test/unit/core/display/Container.test.js index 026848e..668cbed 100644 --- a/test/unit/core/display/Container.test.js +++ b/test/unit/core/display/Container.test.js @@ -44,9 +44,9 @@ it('should call through to DisplayContainer.destroy', function () { var container = new PIXI.Container(); - expect(container.position).to.not.equal(null); + expect(container.transform).to.not.equal(null); container.destroy(); - expect(container.position).to.equal(null); + expect(container.transform).to.equal(null); }); it('should set children to null', function () { @@ -63,8 +63,8 @@ container.addChild(child); container.destroy(); - expect(container.position).to.equal(null); - expect(child.position).to.not.equal(null); + expect(container.transform).to.equal(null); + expect(child.transform).to.not.equal(null); }); it('should destroy children if children flag is set', function () { @@ -73,8 +73,8 @@ container.addChild(child); container.destroy({children: true}); - expect(container.position).to.equal(null); - expect(child.position).to.equal(null); + expect(container.transform).to.equal(null); + expect(child.transform).to.equal(null); }); it('should pass opts on to children if children flag is set', function () { diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 8002ee4..9830912 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -501,11 +501,7 @@ */ DisplayObject.prototype.destroy = function () { - - this.position = null; - this.scale = null; - this.pivot = null; - this.skew = null; + this.transform = null; this.parent = null; diff --git a/test/unit/core/display/Container.test.js b/test/unit/core/display/Container.test.js index 026848e..668cbed 100644 --- a/test/unit/core/display/Container.test.js +++ b/test/unit/core/display/Container.test.js @@ -44,9 +44,9 @@ it('should call through to DisplayContainer.destroy', function () { var container = new PIXI.Container(); - expect(container.position).to.not.equal(null); + expect(container.transform).to.not.equal(null); container.destroy(); - expect(container.position).to.equal(null); + expect(container.transform).to.equal(null); }); it('should set children to null', function () { @@ -63,8 +63,8 @@ container.addChild(child); container.destroy(); - expect(container.position).to.equal(null); - expect(child.position).to.not.equal(null); + expect(container.transform).to.equal(null); + expect(child.transform).to.not.equal(null); }); it('should destroy children if children flag is set', function () { @@ -73,8 +73,8 @@ container.addChild(child); container.destroy({children: true}); - expect(container.position).to.equal(null); - expect(child.position).to.equal(null); + expect(container.transform).to.equal(null); + expect(child.transform).to.equal(null); }); it('should pass opts on to children if children flag is set', function () { diff --git a/test/unit/core/text/Text.test.js b/test/unit/core/text/Text.test.js index eecf9a0..4564c06 100644 --- a/test/unit/core/text/Text.test.js +++ b/test/unit/core/text/Text.test.js @@ -22,8 +22,8 @@ text.addChild(child); text.destroy({children: true}); - expect(text.position).to.equal(null); - expect(child.position).to.equal(null); + expect(text.transform).to.equal(null); + expect(child.transform).to.equal(null); }); it('should accept boolean correctly', function () { @@ -32,8 +32,8 @@ text.addChild(child); text.destroy(true); - expect(text.position).to.equal(null); - expect(child.position).to.equal(null); + expect(text.transform).to.equal(null); + expect(child.transform).to.equal(null); }); it('should pass opts on to children if children flag is set', function () {