diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index ee28d1f..3df2e4f 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -99,8 +99,7 @@ var shader = webGLData.shader; renderer.bindShader(shader) - - shader.uniforms.translationMatrix = graphics.worldTransform.toArray(true); + shader.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true); shader.uniforms.tint = utils.hex2rgb(graphics.tint); shader.uniforms.alpha = graphics.worldAlpha; @@ -130,7 +129,6 @@ } - // flag the graphics as not dirty as we are about to update it... graphics.dirty = false; @@ -205,9 +203,9 @@ */ GraphicsRenderer.prototype.getWebGLData = function (webGL, type) { - var webGLData; + var webGLData = webGL.data[webGL.data.length-1]; - if (!webGL.data.length || webGLData.points.length > 320000) + if (!webGLData || webGLData.points.length > 320000) { webGLData = this.graphicsDataPool.pop() || new WebGLGraphicsData(webGL.gl, this.primitiveShader); webGLData.reset(type); @@ -215,5 +213,7 @@ } webGLData.dirty = true; + + return webGLData; }; diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index ee28d1f..3df2e4f 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -99,8 +99,7 @@ var shader = webGLData.shader; renderer.bindShader(shader) - - shader.uniforms.translationMatrix = graphics.worldTransform.toArray(true); + shader.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true); shader.uniforms.tint = utils.hex2rgb(graphics.tint); shader.uniforms.alpha = graphics.worldAlpha; @@ -130,7 +129,6 @@ } - // flag the graphics as not dirty as we are about to update it... graphics.dirty = false; @@ -205,9 +203,9 @@ */ GraphicsRenderer.prototype.getWebGLData = function (webGL, type) { - var webGLData; + var webGLData = webGL.data[webGL.data.length-1]; - if (!webGL.data.length || webGLData.points.length > 320000) + if (!webGLData || webGLData.points.length > 320000) { webGLData = this.graphicsDataPool.pop() || new WebGLGraphicsData(webGL.gl, this.primitiveShader); webGLData.reset(type); @@ -215,5 +213,7 @@ } webGLData.dirty = true; + + return webGLData; }; diff --git a/src/core/graphics/webgl/utils/buildPoly.js b/src/core/graphics/webgl/utils/buildPoly.js index 96e796a..bcd56a7 100644 --- a/src/core/graphics/webgl/utils/buildPoly.js +++ b/src/core/graphics/webgl/utils/buildPoly.js @@ -12,9 +12,9 @@ var buildPoly = function (graphicsData, webGLData) { graphicsData.points = graphicsData.shape.points.slice(); - - var points = graphicsData.points; + var points = graphicsData.points; + // need to add the points the the graphics object.. if (graphicsData.shape.closed) { @@ -48,7 +48,7 @@ var triangles = earcut(points, null, 2); if (!triangles) { - return false; + return } var vertPos = verts.length / 6; @@ -75,8 +75,6 @@ { buildLine(graphicsData, webGLData); } - - return true; };