mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Disable node lasso selection when zoomed out (re: #7728)
This commit is contained in:
@@ -51,19 +51,19 @@ export function behaviorLasso(context) {
|
||||
function lassoed() {
|
||||
if (!lasso) return [];
|
||||
|
||||
if (!context.map().editableDataEnabled(true /* skipZoomCheck */)) return [];
|
||||
|
||||
var graph = context.graph();
|
||||
var bounds = lasso.extent().map(context.projection.invert);
|
||||
var extent = geoExtent(normalize(bounds[0], bounds[1]));
|
||||
|
||||
var limitToNodes;
|
||||
|
||||
if (context.map().isInWideSelection()) {
|
||||
if (context.map().editableDataEnabled(true /* skipZoomCheck */) && context.map().isInWideSelection()) {
|
||||
// only select from the visible nodes
|
||||
limitToNodes = new Set(utilGetAllNodes(context.selectedIDs(), context.graph()));
|
||||
limitToNodes = new Set(utilGetAllNodes(context.selectedIDs(), graph));
|
||||
} else if (!context.map().editableDataEnabled()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var bounds = lasso.extent().map(context.projection.invert);
|
||||
var extent = geoExtent(normalize(bounds[0], bounds[1]));
|
||||
|
||||
var intersects = context.history().intersects(extent).filter(function(entity) {
|
||||
return entity.type === 'node' &&
|
||||
(!limitToNodes || limitToNodes.has(entity)) &&
|
||||
|
||||
Reference in New Issue
Block a user