diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index cef8262..56144ec 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -36,8 +36,8 @@ * @property texture * @type Texture */ - this.texture = texture; - + this.texture = texture || PIXI.Texture.emptyTexture;; + /** * The width of the sprite (this is initially set by the texture) * @@ -83,7 +83,7 @@ */ this.shader = null; - if(texture.baseTexture.hasLoaded) + if(this.texture.baseTexture.hasLoaded) { this.onTextureUpdate(); } diff --git a/src/pixi/display/Sprite.js b/src/pixi/display/Sprite.js index cef8262..56144ec 100644 --- a/src/pixi/display/Sprite.js +++ b/src/pixi/display/Sprite.js @@ -36,8 +36,8 @@ * @property texture * @type Texture */ - this.texture = texture; - + this.texture = texture || PIXI.Texture.emptyTexture;; + /** * The width of the sprite (this is initially set by the texture) * @@ -83,7 +83,7 @@ */ this.shader = null; - if(texture.baseTexture.hasLoaded) + if(this.texture.baseTexture.hasLoaded) { this.onTextureUpdate(); } diff --git a/src/pixi/renderers/canvas/CanvasGraphics.js b/src/pixi/renderers/canvas/CanvasGraphics.js index 97224d6..1fb5372 100644 --- a/src/pixi/renderers/canvas/CanvasGraphics.js +++ b/src/pixi/renderers/canvas/CanvasGraphics.js @@ -86,7 +86,7 @@ { context.globalAlpha = data.fillAlpha * worldAlpha; context.fillStyle = '#' + ('00000' + ( fillColor | 0).toString(16)).substr(-6); - context.colorRect(shape.x, shape.y, shape.width, shape.height); + context.fillRect(shape.x, shape.y, shape.width, shape.height); } if(data.lineWidth)