怎么beginPath()没起作用啊
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Canvas Circle (imooc)</title>
<link rel="stylesheet" href="">
<script type="text/javascript">
window.onload = function(){
var canvas = document.getElementById("mycanvas");
var context = canvas.getContext("2d");
context.lineWidth = 3;
context.strokeStyle = "#005588";
for (var i = 0;i < 10;i++){
context.beginPath();
context.arc(50 + i*100, 60, 40 , 0, 2*Math.PI*(i+1)/10);
context.closePath();
context.stroke();
}
for (var i = 0;i < 10;i++){
context.beginPath();
context.arc(50 + i*100, 60, 40 , 0, 2*Math.PI*(i+1)/10,true);
context.stroke();
}
}
</script>
</head>
<body>
<canvas id="mycanvas" width="1024" height="768" style="border: 1px solid black;display: block;margin:50px auto;">
</canvas>
</body>
</html>