<!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>運行效果為什么左邊會出現(xiàn)紅圈這部分線,而右邊卻沒有?
求指教!canvas繪制路徑的問題?
illuminiti
2016-06-01 18:18:34