mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 22:46:38 +02:00
Join should run Reverse where necessary (fixes #652)
This commit is contained in:
@@ -24,7 +24,8 @@ iD.actions.Join = function(ids) {
|
||||
// a <-- b ==> c
|
||||
// Expected result:
|
||||
// a <-- b <-- c
|
||||
nodes = b.nodes.slice().reverse().concat(a.nodes.slice(1));
|
||||
b = iD.actions.Reverse(idB)(graph).entity(idB);
|
||||
nodes = b.nodes.slice().concat(a.nodes.slice(1));
|
||||
|
||||
} else if (a.first() === b.last()) {
|
||||
// a <-- b <== c
|
||||
@@ -42,7 +43,8 @@ iD.actions.Join = function(ids) {
|
||||
// a --> b <== c
|
||||
// Expected result:
|
||||
// a --> b --> c
|
||||
nodes = a.nodes.concat(b.nodes.slice().reverse().slice(1));
|
||||
b = iD.actions.Reverse(idB)(graph).entity(idB);
|
||||
nodes = a.nodes.concat(b.nodes.slice().slice(1));
|
||||
}
|
||||
|
||||
graph.parentRelations(b).forEach(function (parent) {
|
||||
|
||||
Reference in New Issue
Block a user