Don't select hidden vertices with the lasso

This commit is contained in:
Bryan Housel
2016-01-04 12:07:57 -05:00
parent 63ab1e1267
commit 56e97ba256
+5 -5
View File
@@ -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) {