Changeset 12969 in josm
- Timestamp:
- 2017-10-09T21:26:26+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r12630 r12969 505 505 return false; 506 506 507 sourceWays.removeIf(w -> w.isIncomplete() || w.getNodesCount() == 0); 508 507 509 if (!sourceWays.contains(referenceSegment.way)) { 508 510 clearSourceWays(); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r12726 r12969 44 44 */ 45 45 public ParallelWays(Collection<Way> sourceWays, boolean copyTags, int refWayIndex) { 46 // Possible/sensible to use Prim etiveDeepCopy here?46 // Possible/sensible to use PrimitiveDeepCopy here? 47 47 48 48 // Make a deep copy of the ways, keeping the copied ways connected … … 50 50 Map<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size()); 51 51 for (Way w : sourceWays) { 52 if (!splitNodeMap.containsKey(w.firstNode())) { 53 splitNodeMap.put(w.firstNode(), copyNode(w.firstNode(), copyTags)); 54 } 55 if (!splitNodeMap.containsKey(w.lastNode())) { 56 splitNodeMap.put(w.lastNode(), copyNode(w.lastNode(), copyTags)); 57 } 52 copyNodeInMap(splitNodeMap, w.firstNode(), copyTags); 53 copyNodeInMap(splitNodeMap, w.lastNode(), copyTags); 58 54 } 59 55 ways = new ArrayList<>(sourceWays.size()); … … 125 121 } 126 122 123 private static void copyNodeInMap(Map<Node, Node> splitNodeMap, Node node, boolean copyTags) { 124 if (!splitNodeMap.containsKey(node)) { 125 splitNodeMap.put(node, copyNode(node, copyTags)); 126 } 127 } 128 127 129 /** 128 130 * Determines if the nodes graph form a closed path
Note:
See TracChangeset
for help on using the changeset viewer.