Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-utilities

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-utilities - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

28

canvas-utilities.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc