canvas-5-polyfill
Advanced tools
Comparing version
@@ -12,2 +12,13 @@ /** | ||
*/ | ||
if (CanvasRenderingContext2D.prototype.ellipse == undefined) { | ||
CanvasRenderingContext2D.prototype.ellipse = function(x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) { | ||
this.save(); | ||
this.translate(x, y); | ||
this.rotate(rotation); | ||
this.scale(radiusX, radiusY); | ||
this.arc(0, 0, 1, startAngle, endAngle, antiClockwise); | ||
this.restore(); | ||
} | ||
} | ||
if (typeof Path2D !== 'function') { | ||
@@ -39,12 +50,2 @@ (function() { | ||
if (CanvasRenderingContext2D.prototype.ellipse == undefined) { | ||
CanvasRenderingContext2D.prototype.ellipse = function(x, y, radiusX, radiusY, rotation, startAngle, endAngle, antiClockwise) { | ||
this.save(); | ||
this.translate(x, y); | ||
this.rotate(rotation); | ||
this.scale(radiusX, radiusY); | ||
this.arc(0, 0, 1, startAngle, endAngle, antiClockwise); | ||
this.restore(); | ||
} | ||
} | ||
@@ -176,1 +177,2 @@ // Path methods that map simply to the CanvasRenderingContext2D. | ||
} | ||
{ | ||
"name": "canvas-5-polyfill", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Polyfill for HTML 5 Canvas features.", | ||
@@ -5,0 +5,0 @@ "main": "canvas.js", |
@@ -21,10 +21,9 @@ describe('AddPath Test Suite.', | ||
tr = { | ||
a: 0, | ||
b: 1, | ||
c: 2, | ||
d: 3, | ||
e: 4, | ||
f: 5 | ||
}; | ||
var tr = document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGMatrix(); | ||
tr.a = 0; | ||
tr.b = 1; | ||
tr.c = 2; | ||
tr.d = 3; | ||
tr.e = 4; | ||
tr.f = 5; | ||
path.addPath(toadd, tr); | ||
@@ -31,0 +30,0 @@ assert.equal(path.ops_.length, 4); |
Sorry, the diff of this file is too big to display
172014
0.31%20
11.11%4726
-0.02%