我的這樣不是對(duì)角線(xiàn),只畫(huà)到橫線(xiàn)的1/2,這是為什么
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>五子棋</title>
? ? <style type="text/css">
? ? ? ? canvas{display: block;
? ? ? ? ? ? padding: 0;
? ? ? ? ? ? ? ? width: 450px;
? ? ? ? ? ? ? ? height: 450px;
? ? ? ? ? ? ? ?margin: auto;
? ? ? ? ? ? ? ? box-shadow: -2px -2px 2px #efefef,5px 5px 5px #b9b9b9;
? ? ? ? ? ? ? ?}
? ? </style>
</head>
<body>
? ?<canvas id="chess" style="width: 480px,"></canvas>?
? ? </body>
? ? <script type="text/javascript">
? ? var chess=document.getElementById("chess");
? ? var context=chess.getContext("2d");
? ? ? ?context.strokeStyle="#bfbfbf";
? ? ? ? context.moveTo(0,0);
? ? ? ? context.lineTo(450,450);
? ? ? ? context.stroke();
? ? </script>
</html>
2016-12-20
我也是啊,為什么呢? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
2016-11-16
看了其他人的,懂了