Skip to content

Commit 9d9d34f

Browse files
author
jikeytang
committed
update
1 parent 091116f commit 9d9d34f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

d/04/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
(function(){
1515
var canvas = document.getElementById('canvas');
1616
var ctx = canvas.getContext('2d');
17-
var d,h,m,s;
17+
var h,m,s;
1818
function now(){
19-
d = new Date();
19+
var d = new Date();
2020
h = d.getHours();
2121
m = d.getMinutes();
2222
s = d.getSeconds();
@@ -64,7 +64,7 @@
6464
ctx.restore();
6565
}
6666
}
67-
//
67+
// 时针
6868
function drawHour(){
6969
ctx.save();
7070
ctx.translate(250, 250);
@@ -78,7 +78,7 @@
7878
ctx.stroke();
7979
ctx.restore();
8080
}
81-
//
81+
// 分针
8282
function drawMin(){
8383
ctx.save();
8484
ctx.translate(250, 250);
@@ -105,10 +105,10 @@
105105
ctx.translate(250, 250);
106106
ctx.rotate(s * 6 * Math.PI / 180); // 6 每秒转过的角度
107107
ctx.beginPath();
108-
ctx.moveTo(0, 150);
108+
ctx.moveTo(0, -150);
109109
ctx.lineWidth = 3;
110110
ctx.strokeStyle = 'red';
111-
ctx.lineTo(0, -25);
111+
ctx.lineTo(0, 25);
112112
ctx.closePath();
113113
ctx.stroke();
114114
ctx.restore();

0 commit comments

Comments
 (0)