已采纳回答 / 窗景
function calcDistance(loc1, loc2) { return Math.sqrt((loc1.x - loc2.x) * (loc1.x - loc2) + (loc1.x + loc2.x) * (loc1.x + loc2))}应改为:function calcDistance(loc1, loc2) { return Math.sqrt((loc1.x - loc2.x) * (loc1.x - loc2.x) + (loc1.y - loc2.y) * (loc1....
2016-01-10
虚线 我刚一开始想就是 for循环 moveTo 和LineTo 然后google下 基本上都是这个思路
不过
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
已经有新的方法啦~~
不过
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
已经有新的方法啦~~
2016-01-08