Malisa Huzaifa - Web Multimedia HTML6 Canvas & SVG

96 canvas.addEventListener("mousemove", draw, false); canvas.addEventListener("touchend", stop, false); canvas.addEventListener("mouseup", stop, false); canvas.addEventListener("mouseout", stop, false); function start(event){ is_drawing = true; context.beginPath(); context.moveTo(event.clientX - canvas.offsetLeft, event.clientY - canvas.offsetTop); event.preventDefault(); } function draw(event){ if (is_drawing){ context.lineTo(event.clientX - canvas.offsetLeft, event.clientY - canvas.offsetTop); context.strokeStyle = draw_color; context.lineWidth = draw_width; context.lineCap = "round"; context.lineJoin = "round"; context.stroke(); } event.preventDefault(); }

RkJQdWJsaXNoZXIy MTM3NDc5MQ==