diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 7a51d9a..1a78039 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -721,8 +721,8 @@ { this._generateCachedSprite(); - // we will also need to update the texture - this.updateCachedSpriteTexture(); + // we will also need to update the texture + this.updateCachedSpriteTexture(); this.cachedSpriteDirty = false; this.dirty = false; @@ -773,30 +773,6 @@ }; /** - * Updates texture size based on canvas size - * - * @method updateCachedSpriteTexture - * @private - */ -PIXI.Graphics.prototype.updateCachedSpriteTexture = function() -{ - var cachedSprite = this._cachedSprite; - var texture = cachedSprite.texture; - var canvas = cachedSprite.buffer.canvas; - - texture.baseTexture.width = canvas.width; - texture.baseTexture.height = canvas.height; - texture.crop.width = texture.frame.width = canvas.width; - texture.crop.height = texture.frame.height = canvas.height; - - cachedSprite._width = canvas.width; - cachedSprite._height = canvas.height; - - // update the dirty base textures - texture.baseTexture.dirty(); -}; - -/** * Retrieves the bounds of the graphic shape as a rectangle object * * @method getBounds @@ -1000,6 +976,30 @@ }; /** + * Updates texture size based on canvas size + * + * @method updateCachedSpriteTexture + * @private + */ +PIXI.Graphics.prototype.updateCachedSpriteTexture = function() +{ + var cachedSprite = this._cachedSprite; + var texture = cachedSprite.texture; + var canvas = cachedSprite.buffer.canvas; + + texture.baseTexture.width = canvas.width; + texture.baseTexture.height = canvas.height; + texture.crop.width = texture.frame.width = canvas.width; + texture.crop.height = texture.frame.height = canvas.height; + + cachedSprite._width = canvas.width; + cachedSprite._height = canvas.height; + + // update the dirty base textures + texture.baseTexture.dirty(); +}; + +/** * Destroys a previous cached sprite. * * @method destroyCachedSprite