- Timestamp:
- 2012-11-04T18:43:45+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r5401 r5570 11 11 import java.util.Arrays; 12 12 import java.util.Collection; 13 import java.util.Collections; 13 14 import java.util.HashSet; 14 15 import java.util.Iterator; … … 190 191 return null; 191 192 193 // Special case - one of the selected ways touches (not cross) way that we want to split 194 if (selectedNodes.size() == 1) { 195 Node n = selectedNodes.get(0); 196 List<Way> referedWays = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class); 197 Way inTheMiddle = null; 198 boolean foundSelected = false; 199 for (Way w: referedWays) { 200 if (selectedWays.contains(w)) { 201 foundSelected = true; 202 } 203 if (w.getNode(0) != n && w.getNode(w.getNodesCount() - 1) != n) { 204 if (inTheMiddle == null) { 205 inTheMiddle = w; 206 } else { 207 inTheMiddle = null; 208 break; 209 } 210 } 211 } 212 if (foundSelected && inTheMiddle != null) 213 return Collections.singletonList(inTheMiddle); 214 } 215 192 216 // List of ways shared by all nodes 193 217 List<Way> result = new ArrayList<Way>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class)); … … 487 511 tr("Split way {0} into {1} parts", way.getDisplayName(DefaultNameFormatter.getInstance()),wayChunks.size()), 488 512 commandList 489 ),490 newSelection,491 way,492 newWays493 );513 ), 514 newSelection, 515 way, 516 newWays 517 ); 494 518 } 495 519
Note:
See TracChangeset
for help on using the changeset viewer.