Skip to content

Instantly share code, notes, and snippets.

View sketchpad.js
function Sketchpad(element) {
var canvas, ctx, mouseX, mouseY, mouseDown=0, touchX, touchY, lastX=-1, lastY=-1;
function drawLine(ctx, x, y, size) {
if ( lastX == -1 ) {
lastX=x;
lastY=y;
}
r = 0; g = 0; b = 0; a = 255;