Fix comparisons in subpath

This commit is contained in:
Ansis Brammanis
2013-01-31 10:50:14 -05:00
parent 5c1d3cc18e
commit c69345e039
+2 -2
View File
@@ -156,7 +156,7 @@ iD.svg.Labels = function(projection) {
for (var i = 0; i < nodes.length - 1; i++) {
var current = segmentLength(i);
var portion;
if (!start && sofar + current > from) {
if (!start && sofar + current >= from) {
portion = (from - sofar) / current;
start = [
nodes[i][0] + portion * (nodes[i + 1][0] - nodes[i][0]),
@@ -164,7 +164,7 @@ iD.svg.Labels = function(projection) {
];
i0 = i + 1;
}
if (!end && sofar + current > to) {
if (!end && sofar + current >= to) {
portion = (to - sofar) / current;
end = [
nodes[i][0] + portion * (nodes[i + 1][0] - nodes[i][0]),