mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-03 21:48:03 +02:00
dblclick a shared way adds vertex to all ways
This commit is contained in:
+22
-3
@@ -113,9 +113,28 @@ iD.modes.Select = function(context, selection, initial) {
|
||||
d3.mouse(context.surface().node()), context),
|
||||
node = iD.Node({ loc: choice.loc });
|
||||
|
||||
context.perform(
|
||||
iD.actions.AddEntity(node),
|
||||
iD.actions.AddVertex(datum.id, node.id, choice.index),
|
||||
var prev = datum.nodes[choice.index - 1],
|
||||
next = datum.nodes[choice.index],
|
||||
prevParents = context.graph().parentWays({ id: prev });
|
||||
|
||||
context.perform(iD.actions.AddEntity(node));
|
||||
|
||||
for (var i = 0; i < prevParents.length; i++) {
|
||||
var p = prevParents[i];
|
||||
for (var k = 0; k < p.nodes.length; k++) {
|
||||
if (p.nodes[k] === prev) {
|
||||
if (p.nodes[k-1] === next) {
|
||||
context.perform(iD.actions.AddVertex(p.id, node.id, k));
|
||||
break;
|
||||
} else if (p.nodes[k+1] === next) {
|
||||
context.perform(iD.actions.AddVertex(p.id, node.id, k+1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.perform(iD.actions.Noop(),
|
||||
t('operations.add.annotation.vertex'));
|
||||
|
||||
d3.event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user