Fix flickering after redrawing active elems

This commit is contained in:
Ansis Brammanis
2013-02-05 18:47:28 -05:00
parent 5eb0644242
commit 14fc1d9c0d
+7 -1
View File
@@ -28,7 +28,13 @@ 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 || datum.id === segment.id) {
context.surface().selectAll('.way, .node')
.filter(function (d) {
return d.id === end.id || d.id === segment.id;
})
.classed('active', true);
} else if (datum.type === 'node') {
loc = datum.loc;
} else if (datum.type === 'way') {
loc = iD.geo.chooseIndex(datum, d3.mouse(context.surface().node()), context).loc;