diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index c5ddf38..f246832 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -215,8 +215,8 @@ */ Sprite.prototype.getBounds = function (matrix) { - var width = this.texture.frame.width; - var height = this.texture.frame.height; + var width = this._texture._frame.width; + var height = this._texture._frame.height; var w0 = width * (1-this.anchor.x); var w1 = width * -this.anchor.x; diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index c5ddf38..f246832 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -215,8 +215,8 @@ */ Sprite.prototype.getBounds = function (matrix) { - var width = this.texture.frame.width; - var height = this.texture.frame.height; + var width = this._texture._frame.width; + var height = this._texture._frame.height; var w0 = width * (1-this.anchor.x); var w1 = width * -this.anchor.x; diff --git a/src/core/textures/Texture.js b/src/core/textures/Texture.js index 1c24d94..949991d 100644 --- a/src/core/textures/Texture.js +++ b/src/core/textures/Texture.js @@ -37,6 +37,8 @@ baseTexture = baseTexture.baseTexture; } + // console.log(frame); + /** * The base texture that this texture uses. * @@ -101,7 +103,7 @@ * * @member {Rectangle} */ - this.crop = crop || new math.Rectangle(0, 0, 1, 1); + this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1); if (baseTexture.hasLoaded) { @@ -148,10 +150,7 @@ this.width = frame.width; this.height = frame.height; - this.crop.x = frame.x; - this.crop.y = frame.y; - this.crop.width = frame.width; - this.crop.height = frame.height; + this.crop = frame; if (!this.trim && (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height)) { @@ -189,6 +188,7 @@ // TODO this code looks confusing.. boo to abusing getters and setterss! if (this.noFrame) { + console.log("NO FRAME") this.frame = new math.Rectangle(0, 0, baseTexture.width, baseTexture.height); } else