From 1b70a68214c559b7c4d0bbde1f5cfbc8ba3adf85 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Mon, 4 Feb 2013 17:14:56 -0500 Subject: [PATCH] Revert "Don't snap to midpoints, snap to their parent way" This reverts commit 13b0b540a7cbc15d0c67f067f72a3f3f16092e62. Conflicts: js/id/behavior/draw_way.js --- js/id/behavior/draw_way.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/js/id/behavior/draw_way.js b/js/id/behavior/draw_way.js index 32d05538f..64ec15e51 100644 --- a/js/id/behavior/draw_way.js +++ b/js/id/behavior/draw_way.js @@ -28,19 +28,10 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { function move(datum) { var loc = context.map().mouseCoordinates(); - if (datum.type === 'node') { - if (datum.id === end.id) { - context.surface().selectAll('.way, .node') - .filter(function (d) { return d.id === end.id; }) - .classed('active', true); - } else { - loc = datum.loc; - } - } else if (datum.type === 'midpoint' || datum.type === 'way') { - var way = datum.type === 'way' ? - datum : - context.entity(datum.ways[0].id); - loc = iD.geo.chooseIndex(way, d3.mouse(context.surface().node()), context).loc; + if (datum.type === 'node' || datum.type === 'midpoint') { + loc = datum.loc; + } else if (datum.type === 'way') { + loc = iD.geo.chooseIndex(datum, d3.mouse(context.surface().node()), context).loc; } context.replace(iD.actions.MoveNode(end.id, loc));