From 287e952592af81479a6f6e7962320891b5252ce6 Mon Sep 17 00:00:00 2001 From: Code WvS Date: Sun, 8 Mar 2015 11:43:08 +0100 Subject: be less accurate with polygon creation --- objects.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 868dc43..87ee8b7 100644 --- a/objects.js +++ b/objects.js @@ -3346,7 +3346,9 @@ SpriteMorph.prototype.drawLine = function (start, dest) { } else { var latlngs = window.polylines[this.myPolylineIndex].getLatLngs(); for (var j = 0; j < latlngs.length; j++) { - if (latlngs[j].distanceTo(destLatLng) < 0.1) { + // If a distance between two points is <= 1 meter, + // call them "the same" + if (latlngs[j].distanceTo(destLatLng) <= 1) { var polyLL = window.polylines[this.myPolylineIndex] .spliceLatLngs(j, latlngs.length) .concat([destLatLng]); -- cgit v1.3.1