webdial

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

commit 199e9a30ad98c21a193b2364f5468218174c42ca
parent c23ca4bd694eb30505cd0be9fe9adb345eed71b3
Author: Sean Lynch <seanl@literati.org>
Date:   Wed,  7 Sep 2011 22:08:30 -0700

Transform the last point too.

Diffstat:
Mwebdial.js | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/webdial.js b/webdial.js @@ -17,8 +17,10 @@ function WebDial(canvas) { $.each(continents, function(continent, polygons) { console.debug("Drawing", continent); $.each(polygons, function(i, points) { + console.debug("Drawing", points.length, "points"); ctx.beginPath(); - ctx.moveTo(points[points.length-1]); + 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])); });