diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 12aa944..b4bae09 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -529,21 +529,13 @@ * @param width {Number} The width of the rectangle * @param height {Number} The height of the rectangle * @param radius {Number} Radius of the rectangle corners - *//* + */ PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) { - if (!this.currentPath.points.length) this.graphicsData.pop(); - - // this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, - /// fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, - // points:[x, y, width, height, radius], shape:new PIXI.Rectangle(x,y, width, height), type:PIXI.Graphics.RREC}; - - this.graphicsData.push(this.currentPath); - this.dirty = true; + this.drawShape({ points:[x, y, width, height, radius], type:PIXI.Graphics.RREC }); return this; }; -*/ /** * Draws a circle. diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 12aa944..b4bae09 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -529,21 +529,13 @@ * @param width {Number} The width of the rectangle * @param height {Number} The height of the rectangle * @param radius {Number} Radius of the rectangle corners - *//* + */ PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) { - if (!this.currentPath.points.length) this.graphicsData.pop(); - - // this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, - /// fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, - // points:[x, y, width, height, radius], shape:new PIXI.Rectangle(x,y, width, height), type:PIXI.Graphics.RREC}; - - this.graphicsData.push(this.currentPath); - this.dirty = true; + this.drawShape({ points:[x, y, width, height, radius], type:PIXI.Graphics.RREC }); return this; }; -*/ /** * Draws a circle. diff --git a/src/pixi/renderers/canvas/CanvasGraphics.js b/src/pixi/renderers/canvas/CanvasGraphics.js index b2ed5e8..66ad931 100644 --- a/src/pixi/renderers/canvas/CanvasGraphics.js +++ b/src/pixi/renderers/canvas/CanvasGraphics.js @@ -145,14 +145,14 @@ context.stroke(); } } - /* else if (data.type === PIXI.Graphics.RREC) { - var rx = points[0]; - var ry = points[1]; - var width = points[2]; - var height = points[3]; - var radius = points[4]; + var pts = shape.points; + var rx = pts[0]; + var ry = pts[1]; + var width = pts[2]; + var height = pts[3]; + var radius = pts[4]; var maxRadius = Math.min(width, height) / 2 | 0; radius = radius > maxRadius ? maxRadius : radius; @@ -182,7 +182,6 @@ context.stroke(); } } - */ } }; diff --git a/src/pixi/primitives/Graphics.js b/src/pixi/primitives/Graphics.js index 12aa944..b4bae09 100644 --- a/src/pixi/primitives/Graphics.js +++ b/src/pixi/primitives/Graphics.js @@ -529,21 +529,13 @@ * @param width {Number} The width of the rectangle * @param height {Number} The height of the rectangle * @param radius {Number} Radius of the rectangle corners - *//* + */ PIXI.Graphics.prototype.drawRoundedRect = function( x, y, width, height, radius ) { - if (!this.currentPath.points.length) this.graphicsData.pop(); - - // this.currentPath = {lineWidth:this.lineWidth, lineColor:this.lineColor, lineAlpha:this.lineAlpha, - /// fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, - // points:[x, y, width, height, radius], shape:new PIXI.Rectangle(x,y, width, height), type:PIXI.Graphics.RREC}; - - this.graphicsData.push(this.currentPath); - this.dirty = true; + this.drawShape({ points:[x, y, width, height, radius], type:PIXI.Graphics.RREC }); return this; }; -*/ /** * Draws a circle. diff --git a/src/pixi/renderers/canvas/CanvasGraphics.js b/src/pixi/renderers/canvas/CanvasGraphics.js index b2ed5e8..66ad931 100644 --- a/src/pixi/renderers/canvas/CanvasGraphics.js +++ b/src/pixi/renderers/canvas/CanvasGraphics.js @@ -145,14 +145,14 @@ context.stroke(); } } - /* else if (data.type === PIXI.Graphics.RREC) { - var rx = points[0]; - var ry = points[1]; - var width = points[2]; - var height = points[3]; - var radius = points[4]; + var pts = shape.points; + var rx = pts[0]; + var ry = pts[1]; + var width = pts[2]; + var height = pts[3]; + var radius = pts[4]; var maxRadius = Math.min(width, height) / 2 | 0; radius = radius > maxRadius ? maxRadius : radius; @@ -182,7 +182,6 @@ context.stroke(); } } - */ } }; diff --git a/src/pixi/renderers/webgl/utils/WebGLGraphics.js b/src/pixi/renderers/webgl/utils/WebGLGraphics.js index 9ea5a53..4e8b2ac 100644 --- a/src/pixi/renderers/webgl/utils/WebGLGraphics.js +++ b/src/pixi/renderers/webgl/utils/WebGLGraphics.js @@ -309,7 +309,7 @@ */ PIXI.WebGLGraphics.buildRoundedRectangle = function(graphicsData, webGLData) { - var points = graphicsData.points; + var points = graphicsData.shape.points; var x = points[0]; var y = points[1]; var width = points[2];