Skip to content

Commit

Permalink
prevent way danglers, issue #1373
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Apr 25, 2013
1 parent 4e305ea commit b95529d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/id/behavior/draw_way.js
Expand Up @@ -131,6 +131,11 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) {

// Connect the way to an existing way.
drawWay.addWay = function(loc, edge) {

// Avoid creating duplicate segments
if (edge[0] === way.nodes[way.nodes.length - 1] ||
edge[1] === way.nodes[way.nodes.length - 1]) return;

var newNode = iD.Node({ loc: loc });

context.perform(
Expand Down

0 comments on commit b95529d

Please sign in to comment.