Fix circularize with > 12 vertices (fixes #1054)

This commit is contained in:
John Firebaugh
2013-03-18 17:48:05 -07:00
parent 1203970e22
commit e40090b758
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -42,7 +42,8 @@ iD.actions.Circularize = function(wayId, projection, count) {
}
ids.push(ids[0]);
graph = graph.replace(way.update({nodes: ids}));
way = way.update({nodes: ids});
graph = graph.replace(way);
for (i = 0; i < nodes.length; i++) {
graph.parentWays(nodes[i]).forEach(function(parent) {
+2 -1
View File
@@ -49,7 +49,8 @@ describe("iD.actions.Circularize", function () {
'b': iD.Node({id: 'b', loc: [2, 0]}),
'c': iD.Node({id: 'c', loc: [2, 2]}),
'd': iD.Node({id: 'd', loc: [0, 2]}),
'-': iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'a']}),
'e': iD.Node({id: 'e', loc: [1, 1]}),
'-': iD.Way({id: '-', nodes: ['a', 'b', 'c', 'd', 'e', 'a']}),
'=': iD.Way({id: '=', nodes: ['d']})
});