不明白秒針為什么要這樣實(shí)現(xiàn)?
function drawSecond(second){
? ? cxt.save();
? ? cxt.beginPath();
? ? cxt.fillStyle = '#c14543';
? ? var rad = 2 * Math.PI / 60 * second;
??? cxt.rotate(rad);
? ?cxt.moveTo(-2* rem,20* rem);
? ? cxt.lineTo(2* rem,20* rem);
? ? cxt.lineTo(1,-r+18* rem);
? ? cxt.lineTo(-1,-r+18* rem);
? ? cxt.fill();
? ? cxt.restore();
}
為什么這樣實(shí)現(xiàn)秒鐘,而不是像時(shí)針和分針那樣?
2016-10-18
是為了讓秒針有個(gè)不同的效果,秒針尾部大些,秒針頭部小些,看著更美觀~。~