From 56e97ba256226d3b84e0924629b80b1905d866e4 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 4 Jan 2016 12:07:57 -0500 Subject: [PATCH] Don't select hidden vertices with the lasso --- js/id/behavior/lasso.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/id/behavior/lasso.js b/js/id/behavior/lasso.js index 4e183b3aa..355f14059 100644 --- a/js/id/behavior/lasso.js +++ b/js/id/behavior/lasso.js @@ -1,7 +1,6 @@ iD.behavior.Lasso = function(context) { var behavior = function(selection) { - var mouse = null, lasso; @@ -35,21 +34,22 @@ iD.behavior.Lasso = function(context) { } function mouseup() { - selection .on('mousemove.lasso', null) .on('mouseup.lasso', null); if (!lasso) return; - var extent = iD.geo.Extent( + var graph = context.graph(), + extent = iD.geo.Extent( normalize(context.projection.invert(lasso.a()), context.projection.invert(lasso.b()))); lasso.close(); - var selected = context.intersects(extent).filter(function (entity) { - return entity.type === 'node'; + var selected = context.intersects(extent).filter(function(entity) { + return entity.type === 'node' && + !context.features().isHidden(entity, graph, entity.geometry(graph)); }); if (selected.length) {