canvas-utilities
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -5,14 +5,22 @@ 'use strict'; | ||
function ellipse(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(); | ||
} | ||
// polyfill for the new ellipse method | ||
Canvas.Context2d.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 (Canvas.Context2d && Canvas.Context2d.prototype.ellipse === undefined) { | ||
// server-side using automattic/node-canvas | ||
Canvas.Context2d.prototype.ellipse = ellipse; | ||
} else if (typeof CanvasRenderingContext2D !== 'undefined' && | ||
CanvasRenderingContext2D.prototype.ellipse === undefined) { | ||
// browser-side | ||
CanvasRenderingContext2D.prototype.ellipse = ellipse; | ||
} | ||
exports.Canvas = Canvas; |
{ | ||
"name": "canvas-utilities", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Utilities for use with node-canvas or the browser's <canvas> element.", | ||
@@ -5,0 +5,0 @@ "main": "canvas-utilities.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14454
420