diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index fb96bae..66b1699 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -111,6 +111,15 @@ this.dirty = true; /** + * Used to detect if the webgl graphics object has changed. If this is set to true then the graphics object will be recalculated. + * + * @property webGLDirty + * @type Boolean + * @private + */ + this.webGLDirty = false; + + /** * Used to detect if the cached sprite object needs to be updated. * * @property cachedSpriteDirty @@ -614,7 +623,7 @@ */ PIXI.Graphics.prototype.generateTexture = function(resolution, scaleMode) { - resolution = resolution || 2; + resolution = resolution || 1; var bounds = this.getBounds(); @@ -678,6 +687,13 @@ renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); } + // check if the webgl graphic needs to be updated + if(this.webGLDirty) + { + this.dirty = true; + this.webGLDirty = false; + } + PIXI.WebGLGraphics.renderGraphics(this, renderSession); // only render if it has children! @@ -783,6 +799,7 @@ if(this.dirty) { this.updateBounds(); + this.webGLDirty = true; this.cachedSpriteDirty = true; this.dirty = false; }