From f9f14360076b45aecf8e0d0e2e54e7cfe7270711 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 12 Jan 2013 01:33:13 -0500 Subject: [PATCH] Pixel-determined midpoints. betting that computation is better than tons of svg elements --- js/id/svg/midpoints.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/id/svg/midpoints.js b/js/id/svg/midpoints.js index f04e14ba8..185afc696 100644 --- a/js/id/svg/midpoints.js +++ b/js/id/svg/midpoints.js @@ -9,7 +9,9 @@ iD.svg.Midpoints = function() { continue; for (var j = 0; j < entity.nodes.length - 1; j++) { - if (iD.util.geo.dist(entity.nodes[j].loc, entity.nodes[j + 1].loc) > 0.0001) { + var a = projection(entity.nodes[j].loc); + var b = projection(entity.nodes[j + 1].loc); + if (iD.util.geo.dist(a, b) > 40) { midpoints.push({ loc: iD.util.geo.interp(entity.nodes[j].loc, entity.nodes[j + 1].loc, 0.5), way: entity.id,