summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-03-08 11:43:08 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-03-08 11:43:08 +0100
commit287e952592af81479a6f6e7962320891b5252ce6 (patch)
tree70f11862f565987b29530c4aa89b5043af7042f7 /objects.js
parent53f4378325f30728cceeae8d149d69a74ca5556e (diff)
downloadsnap-yow-287e952592af81479a6f6e7962320891b5252ce6.tar.gz
snap-yow-287e952592af81479a6f6e7962320891b5252ce6.zip
be less accurate with polygon creation
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js4
1 files changed, 3 insertions, 1 deletions
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]);