1.0.2 • Published 5 years ago

canvas-draw-js v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

canvas-draw-js

An easy-to-use JavaScript library aimed at making it easier to draw on SVG elements when using a digital pen (such as the Surface Pen).

How to use

import CanvasDrawJS from "canvas-draw-js";

// Prep the svg element to be drawn on
const canvas = new CanvasDrawJS(document.querySelector("svg"));


// Callbacks can be set for various events
canvas.penDownCallback = (path, event) => {};
canvas.penUpCallback = (path, event) => {};

// Same can be done for the eraser end of a pen (if it has one)
canvas.eraserDownCallback = (removedPath, event) => {};
canvas.eraserUpCallback = (event) => {};

Todo

  • Tests need to be made
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago