webdial

Incomplete JS port of moondial.
git clone https://code.literati.org/webdial.git
Log | Files | Refs

commit 3d4b1f7c79a3df98959878f26b8426a0186a2cc7
parent 8a39ef2d7b7e4e0c1762286c2bdc44b20bdc8bb9
Author: Sean Lynch <seanl@literati.org>
Date:   Thu,  8 Sep 2011 08:46:08 -0700

Simplify drawpoly

Diffstat:
Mwebdial.js | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/webdial.js b/webdial.js @@ -12,11 +12,11 @@ function WebDial(canvas) { } ctx.beginPath(); - var lastPoint = points[points.length-1]; - ctx.moveTo(lon2x(lastPoint[0]), lat2y(lastPoint[1])); - $.each(points, function(j, point) { - ctx.lineTo(lon2x(point[0]), lat2y(point[1])); - }); + ctx.moveTo(lon2x(points[0][0]), lat2y(points[0][1])); + var i; + for (i = 1; i < points.length; i++ ) { + ctx.lineTo(lon2x(points[i][0]), lat2y(points[i][1])); + } ctx.fill(); }