mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
don't unclose way if it is part of a larger disconnect operation
This commit is contained in:
@@ -22,7 +22,7 @@ export function actionDisconnect(nodeId, newNodeId) {
|
||||
var action = function(graph) {
|
||||
var node = graph.entity(nodeId);
|
||||
var connections = action.connections(graph);
|
||||
|
||||
|
||||
connections.forEach(function(connection) {
|
||||
var way = graph.entity(connection.wayID);
|
||||
var newNode = osmNode({id: newNodeId, loc: node.loc, tags: node.tags});
|
||||
@@ -59,6 +59,9 @@ export function actionDisconnect(nodeId, newNodeId) {
|
||||
} else {
|
||||
way.nodes.forEach(function(waynode, index) {
|
||||
if (waynode === nodeId) {
|
||||
if (way.isClosed() && parentWays.length > 1 && wayIds && wayIds.includes(way.id) && index === way.nodes.length-1) {
|
||||
return;
|
||||
}
|
||||
candidates.push({ wayID: way.id, index: index });
|
||||
}
|
||||
});
|
||||
@@ -71,7 +74,7 @@ export function actionDisconnect(nodeId, newNodeId) {
|
||||
|
||||
action.disabled = function(graph) {
|
||||
var connections = action.connections(graph);
|
||||
if (connections.length === 0 || (wayIds && wayIds.length !== connections.length))
|
||||
if (connections.length === 0)
|
||||
return 'not_connected';
|
||||
|
||||
var parentWays = graph.parentWays(graph.entity(nodeId));
|
||||
|
||||
Reference in New Issue
Block a user