function drawHour(hour){
ctx.save();
ctx.beginPath();
var rad=2 * Math.PI / 12 * hour;
ctx.rotate(rad);
ctx.lineWidth=6;
ctx.lineCap='round';
ctx.moveTo(0,10);
ctx.lineTo(0,-r/2);
ctx.stroke();
ctx.restore;
}
/*function drawMinute(minute)){
ctx.save();
ctx.beginPath();
var rad=2 * Math.PI / 60 * hour;
ctx.rotate(rad);
ctx.lineWidth=3;
ctx.lineCap='round';
ctx.moveTo(0,10);
ctx.lineTo(0,-r+18);
ctx.stroke();
ctx.restore;
}*/
drawBackground();
drawHour(4);
//drawMinute(3);
drawHour(1);
drawBackground(); drawHour(4); //drawMinute(3); drawHour(1);
一个参数是4 一个参数是1
显示的会一样?