- Timestamp:
- 2008-08-12T14:02:10+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r772 r773 97 97 if (w.deleted || w.incomplete) continue; 98 98 int last = w.nodes.size()-1; 99 Boolean circular = w.nodes.get(0).equals(w.nodes.get(last)); 99 100 int i = 0; 100 101 for (Node wn : w.nodes) { 101 if (( i > 0) && (i < last) && n.equals(wn)) {102 if ((circular || (i > 0 && i < last)) && n.equals(wn)) { 102 103 Integer old = wayOccurenceCounter.get(w); 103 104 wayOccurenceCounter.put(w, (old == null) ? 1 : old+1); … … 130 131 } 131 132 132 133 // If a way and nodes are selected, verify that the nodes are part of the way. 133 134 } else if (selectedWay != null && selectedNodes != null) { 134 135 … … 216 217 217 218 if (wayChunks.size() < 2) { 218 JOptionPane.showMessageDialog(Main.parent, tr("The way cannot be split at the selected nodes. (Hint: Select nodes in the middle of the way.)")); 219 if(wayChunks.get(0).get(0) == wayChunks.get(0).get(wayChunks.get(0).size()-1)) 220 JOptionPane.showMessageDialog(Main.parent, tr("You must select two or more nodes to split a circular way.")); 221 else 222 JOptionPane.showMessageDialog(Main.parent, tr("The way cannot be split at the selected nodes. (Hint: Select nodes in the middle of the way.)")); 219 223 return; 220 224 } 221 Main.debug("wayChunks.size(): " + wayChunks.size()); 222 Main.debug("way id: " + selectedWay.id); 225 //Main.debug("wayChunks.size(): " + wayChunks.size()); 226 //Main.debug("way id: " + selectedWay.id); 223 227 224 228 // build a list of commands, and also a new selection list … … 245 249 wayToAdd.nodes.addAll(chunkIt.next()); 246 250 commandList.add(new AddCommand(wayToAdd)); 247 Main.debug("wayToAdd: " + wayToAdd); 251 //Main.debug("wayToAdd: " + wayToAdd); 248 252 newSelection.add(wayToAdd); 249 253
Note:
See TracChangeset
for help on using the changeset viewer.