<!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag. </canvas> <script> var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.beginPath(); ctx.moveTo(150,5); ctx.lineTo(150,145); ctx.arc(100,75,50,0,0.25*Math.PI); //ctx.beginPath(); ctx.moveTo(50,5); ctx.lineTo(50,145); ctx.arc(100,75,50,0.75*Math.PI,1*Math.PI); //ctx.closePath(); ctx.stroke(); ctx.closePath(); </script> </body> </html>
运行效果
为什么左边会出现红圈这部分线,而右边却没有?
肥仔汇
illuminiti
忘性最大的人
相关分类