Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sagar Jha sagarjhaa

View GitHub Profile
@sagarjhaa
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.beginPath();
ctx.strokeStyle = $('#selColor').val();
ctx.lineWidth = $('#selWidth').val();
You can’t perform that action at this time.