Fix area order. Algorithm is direction sensitive

This commit is contained in:
Ansis Brammanis
2013-01-27 03:32:05 -05:00
parent 46cb57cea7
commit 62e8d4ed64

View File

@@ -11,12 +11,12 @@ iD.svg.Areas = function(projection) {
areas.push({
entity: entity,
area: entity.isDegenerate() ? 0 : d3.geom.polygon(points).area()
area: entity.isDegenerate() ? 0 : Math.abs(d3.geom.polygon(points).area())
});
}
}
areas.sort(function(a, b) { return a.area - b.area; });
areas.sort(function(a, b) { return b.area - a.area; });
var lineString = iD.svg.LineString(projection, graph);