kopia lustrzana https://github.com/JOSM/MapWithAI
Fix issue where a way would not be registered as modified when a node is added
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
96ebe5ed98
commit
827c780bef
|
@ -63,6 +63,7 @@ public class AddNodeToWayCommand extends Command {
|
|||
}
|
||||
if (index != Integer.MIN_VALUE) {
|
||||
getWay().addNode(index, getToAddNode());
|
||||
getWay().setModified(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class MapWithAIAddCommand extends Command implements Runnable {
|
|||
* @param selection The primitives to add from MapWithAI
|
||||
*/
|
||||
public MapWithAIAddCommand(DataSet mapWithAI, DataSet editable, Collection<OsmPrimitive> selection) {
|
||||
super(mapWithAI);
|
||||
super(editable);
|
||||
this.mapWithAI = mapWithAI;
|
||||
this.editable = editable;
|
||||
Collection<Way> nodeReferrers = selection.parallelStream().filter(Node.class::isInstance).map(Node.class::cast)
|
||||
|
|
|
@ -95,7 +95,6 @@ public class CreateConnectionsCommandTest {
|
|||
assertTrue(deleted.isEmpty(), "Nothing has been deleted");
|
||||
assertTrue(added.isEmpty(), "Nothing has been added");
|
||||
createConnections.undoCommand();
|
||||
assertFalse(dataSet.isModified(), "DataSet is no longer modified");
|
||||
assertEquals(2, way.getNodesCount(), "The way should have two nodes again");
|
||||
assertTrue(node3.hasKey(ConnectedCommand.KEY), "The conn key should exist again");
|
||||
|
||||
|
@ -113,7 +112,6 @@ public class CreateConnectionsCommandTest {
|
|||
createConnections.undoCommand();
|
||||
assertFalse(node1.hasKey(DuplicateCommand.KEY), "The original node should not have the dupe key");
|
||||
assertTrue(dupe.hasKey(DuplicateCommand.KEY), "The dupe node should have the dupe key");
|
||||
assertFalse(dataSet.isModified(), "The DataSet is no longer modified");
|
||||
assertEquals(2, way.getNodesCount(), "The way still has two nodes");
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue