skip to Main Content

Javascript – HTML canvas: additional stroke after restore

Consider the following piece of code (test it yourself): function draw() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); ctx.beginPath(); ctx.arc(75, 75, 50, 0, Math.PI * 2, true); // Outer circle ctx.stroke(); ctx.moveTo(75, 75); ctx.save(); ctx.setLineDash([3, 3]); ctx.lineTo(90, 90);…

VIEW QUESTION
Back To Top
Search