Setting Line Width
Change the width of a line on the canvas The lineWidth property of the context ctx sets the width of lines drawn in the future. This value is set before drawing shapes like lines or circles. const canvas = document.querySelector(‘#myCanvas’); const ctx = canvas.getContext(‘2d’); ctx.beginPath(); ctx.moveTo(-35,-7); ctx.lineTo(300,100); ctx.lineWidth = 14; ctx.stroke(); The code ctx.lineWidth = … Read more