mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 05:49:16 +02:00
@@ -99,14 +99,20 @@ export function modeDragNode(context) {
|
||||
function start(entity) {
|
||||
wasMidpoint = entity.type === 'midpoint';
|
||||
|
||||
// vertices classed "sibling" include: (see svg/vertices.js)
|
||||
// - children of selected ways or multipolygons
|
||||
// - vertices sharing a way with selected vertices
|
||||
var selection = d3.selectAll('g.vertex-persistent.' + entity.id),
|
||||
isSelected = !selection.empty() &&
|
||||
(selection.classed('selected') || selection.classed('sibling'));
|
||||
// Things allowed to be dragged include:
|
||||
// - midpoints
|
||||
// - nodes that are selected
|
||||
// - vertices that are selected
|
||||
// - vertices classed 'sibling' which includes (see svg/vertices.js)
|
||||
// - children of selected ways or multipolygons
|
||||
// - vertices sharing a way with selected vertices
|
||||
var selector = 'g.node.point.selected.' + entity.id +
|
||||
', g.vertex-persistent.selected.' + entity.id +
|
||||
', g.vertex-persistent.sibling.' + entity.id;
|
||||
|
||||
isCancelled = d3.event.sourceEvent.shiftKey || !(wasMidpoint || isSelected) ||
|
||||
var isDraggable = wasMidpoint || !d3.select(selector).empty();
|
||||
|
||||
isCancelled = d3.event.sourceEvent.shiftKey || !isDraggable ||
|
||||
context.features().hasHiddenConnections(entity, context.graph());
|
||||
|
||||
if (isCancelled) {
|
||||
|
||||
Reference in New Issue
Block a user