@daeinc/draw
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -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
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
10593
7
127
+ Added@daeinc/array@0.5.1(transitive)
+ Added@daeinc/geom@0.8.1(transitive)
+ Added@daeinc/math@0.5.0(transitive)
- Removed@daeinc/array@0.4.2(transitive)
- Removed@daeinc/geom@0.7.2(transitive)
- Removed@daeinc/math@0.4.0(transitive)
Updated@daeinc/geom@^0.8.0