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

@daeinc/draw

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daeinc/draw - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

21

dist/index.js

@@ -1,4 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.drawSmoothPath = exports.drawRect = exports.drawPath = exports.drawLine = exports.drawFillText = exports.drawCircle = void 0;
/**

@@ -10,7 +7,6 @@ * draw a circle with diameter

*/
const drawCircle = (ctx, pt, diam) => {
export const drawCircle = (ctx, pt, diam) => {
ctx.beginPath();
ctx.arc(pt[0], pt[1], diam * 0.5, 0, Math.PI * 2);
};
exports.drawCircle = drawCircle;
/**

@@ -23,3 +19,3 @@ *

*/
const drawFillText = (ctx, msg, pt
export const drawFillText = (ctx, msg, pt
// options?: { font: string }

@@ -30,3 +26,2 @@ ) => {

};
exports.drawFillText = drawFillText;
/**

@@ -38,3 +33,3 @@ * draw a line

*/
const drawLine = (ctx, pt1, pt2) => {
export const drawLine = (ctx, pt1, pt2) => {
ctx.beginPath();

@@ -44,3 +39,2 @@ ctx.moveTo(pt1[0], pt1[1]);

};
exports.drawLine = drawLine;
/**

@@ -52,3 +46,3 @@ * draw a 2d path. need to manually stroke/fill afterwards.

*/
const drawPath = (ctx, path, close = false) => {
export const drawPath = (ctx, path, close = false) => {
ctx.beginPath();

@@ -61,3 +55,2 @@ ctx.moveTo(path[0][0], path[0][1]);

};
exports.drawPath = drawPath;
/**

@@ -69,3 +62,3 @@ * draw a rectangle

*/
const drawRect = (ctx, pt, size, mode = "corner") => {
export const drawRect = (ctx, pt, size, mode = "corner") => {
ctx.beginPath();

@@ -79,3 +72,2 @@ if (mode === "corner")

};
exports.drawRect = drawRect;
/**

@@ -87,3 +79,3 @@ * use quadratic curve to smoothen hard edges of path. use with geom.generateSmoothPath()

*/
const drawSmoothPath = (ctx, path, close = false) => {
export const drawSmoothPath = (ctx, path, close = false) => {
ctx.beginPath();

@@ -102,3 +94,2 @@ ctx.moveTo(path[0][0], path[0][1]);

};
exports.drawSmoothPath = drawSmoothPath;
//# sourceMappingURL=index.js.map
{
"name": "@daeinc/draw",
"version": "0.2.1",
"version": "0.3.0",
"description": "drawing utilities for HTML5 Canvas",

@@ -19,9 +19,12 @@ "types": "./dist/index.d.ts",

"devDependencies": {
"@daeinc/canvas": "^0.8.0",
"@daeinc/canvas": "^0.12.1",
"jest": "^29.3.1",
"ts-jest": "^29.0.3",
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^29.3.1",
"jest-image-snapshot": "^6.1.0",
"ts-jest": "^29.0.5",
"typescript": "^4.9.4"
},
"dependencies": {
"@daeinc/geom": "^0.7.2"
"@daeinc/geom": "^0.8.0"
},

@@ -28,0 +31,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

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