|
|
@@ -32,17 +32,17 @@ CanvasRenderingContext2D.prototype.dashedLine = function(x1, y1, x2, y2)
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-CanvasRenderingContext2D.prototype.roundedRect = function(x, y, w, h, radius)
|
|
|
+CanvasRenderingContext2D.prototype.roundedRect = function(x, y, width, height, radius)
|
|
|
{
|
|
|
- context.beginPath();
|
|
|
- context.moveTo(x + radius, y);
|
|
|
- context.lineTo(x + width - radius, y);
|
|
|
- context.quadraticCurveTo(x + width, y, x + width, y + radius);
|
|
|
- context.lineTo(x + width, y + height - radius);
|
|
|
- context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
|
|
|
- context.lineTo(x + radius, y + height);
|
|
|
- context.quadraticCurveTo(x, y + height, x, y + height - radius);
|
|
|
- context.lineTo(x, y + radius);
|
|
|
- context.quadraticCurveTo(x, y, x + radius, y);
|
|
|
- context.closePath();
|
|
|
+ this.beginPath();
|
|
|
+ this.moveTo(x + radius, y);
|
|
|
+ this.lineTo(x + width - radius, y);
|
|
|
+ this.quadraticCurveTo(x + width, y, x + width, y + radius);
|
|
|
+ this.lineTo(x + width, y + height - radius);
|
|
|
+ this.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
|
|
|
+ this.lineTo(x + radius, y + height);
|
|
|
+ this.quadraticCurveTo(x, y + height, x, y + height - radius);
|
|
|
+ this.lineTo(x, y + radius);
|
|
|
+ this.quadraticCurveTo(x, y, x + radius, y);
|
|
|
+ this.closePath();
|
|
|
};
|