Skip to content

Instantly share code, notes, and snippets.


Sagar Jha sagarjhaa

View GitHub Profile
sagarjhaa / canvas_drawing.js
Created Apr 7, 2019
How to draw using canvas
View canvas_drawing.js
var mousePressed = false;
var lastX, lastY;
var ctx;
var li = [];
function Draw(x, y, isDown) {
if (isDown) {
ctx.strokeStyle = $('#selColor').val();
ctx.lineWidth = $('#selWidth').val();
You can’t perform that action at this time.