Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r10795 r11108 104 104 if (size == 0) 105 105 throw new IllegalArgumentException("empty list"); 106 if (size == 1) // to avoid division by 0 in mode 2 107 return candidates.get(0); 106 108 107 109 switch (Main.pref.getInteger("merge-nodes.mode", 0)) { 108 110 case 0: 109 Node targetNode = candidates.get(size - 1); 110 for (final Node n : candidates) { // pick last one 111 targetNode = n; 112 } 113 return targetNode; 111 return candidates.get(size - 1); 114 112 case 1: 115 113 double east1 = 0, north1 = 0; 116 114 for (final Node n : candidates) { 117 east1 += n.getEastNorth().east(); 118 north1 += n.getEastNorth().north(); 115 EastNorth en = n.getEastNorth(); 116 east1 += en.east(); 117 north1 += en.north(); 119 118 } 120 119
Note:
See TracChangeset
for help on using the changeset viewer.