MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / draw

Function draw

HTML-Canvas/app.js:27–40  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

25 }
26
27 function draw(event){
28 //if not painting , then return
29 if(!painting) return;
30
31 ctx.lineWidth = rangeElement.value;
32 ctx.lineCap = 'round';
33 ctx.strokeStyle = colorElement.value;
34
35 ctx.lineTo(event.clientX, event.clientY);
36 ctx.stroke();
37
38 ctx.beginPath();
39 ctx.moveTo(event.clientX, event.clientY);
40 }
41
42 window.addEventListener('mousedown', startDrawing);
43 window.addEventListener('mouseup', stopDrawing);

Callers 1

startDrawingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected