- Timestamp:
- 2020-10-13T17:56:43+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r16553 r17187 188 188 List<Command> cmds = new ArrayList<>(); 189 189 List<Node> newNodes = new ArrayList<>(); 190 Way modWay = modifyWay(selectedNode, way, cmds, newNodes); 191 cmds.add(new ChangeNodesCommand(way, modWay.getNodes())); 190 cmds.add(new ChangeNodesCommand(way, modifyWay(selectedNode, way, cmds, newNodes))); 192 191 if (dialog != null) { 193 192 update(dialog, selectedNode, newNodes, cmds); … … 301 300 * @return new way The modified way. Change command must be handled by the caller 302 301 */ 303 private static WaymodifyWay(Node originalNode, Way w, List<Command> cmds, List<Node> newNodes) {302 private static List<Node> modifyWay(Node originalNode, Way w, List<Command> cmds, List<Node> newNodes) { 304 303 // clone the node for the way 305 304 Node newNode = cloneNode(originalNode, cmds); … … 308 307 List<Node> nn = new ArrayList<>(w.getNodes()); 309 308 nn.replaceAll(n -> n == originalNode ? newNode : n); 310 Way newWay = new Way(w); 311 newWay.setNodes(nn); 312 313 return newWay; 309 return nn; 314 310 } 315 311 … … 393 389 if (w.isFirstLastNode(selectedNode)) 394 390 warnParents.add(w); 395 cmds.add(new ChangeNodesCommand(w, modifyWay(selectedNode, w, cmds, newNodes) .getNodes()));391 cmds.add(new ChangeNodesCommand(w, modifyWay(selectedNode, w, cmds, newNodes))); 396 392 } 397 393
Note:
See TracChangeset
for help on using the changeset viewer.