kopia lustrzana https://github.com/JOSM/MapWithAI
Fix node placement in way issue
Signed-off-by: Taylor Smock <smocktaylor@gmail.com>pull/1/head
rodzic
6e6d338f3b
commit
a1fdeca369
|
@ -117,7 +117,7 @@ public class RapiDAddCommand extends Command {
|
|||
* when calling.
|
||||
*/
|
||||
public static void addNodesToWay(Node toAddNode, Way way, Node first, Node second) {
|
||||
int index = Math.min(way.getNodes().indexOf(first), way.getNodes().indexOf(second));
|
||||
int index = Math.max(way.getNodes().indexOf(first), way.getNodes().indexOf(second));
|
||||
way.addNode(index, toAddNode);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,5 +66,6 @@ public class RapiDAddComandTest {
|
|||
ds1.addPrimitive(way1);
|
||||
RapiDAddCommand.createConnections(ds1, Collections.singletonList(way2.firstNode()));
|
||||
Assert.assertEquals(3, way1.getNodesCount());
|
||||
Assert.assertFalse(way1.isFirstLastNode(way2.firstNode()));
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue