转自:http://www.cnblogs.com/artwl/archive/2012/02/28/2372042.html 作者:Artwl 背景 今天在博问中看到一个问题:用canvas 的 lineto方法画对角线,但画出来的图形不对? 这是一个很常见的误区,这里给大家细说一下. 原理 在w3网站上是这样解释的: The canvas element has two attributes to control the size of the coordinate space: width