Changeset 3515 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-09-09T17:14:05+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r3437 r3515 118 118 while (it.hasNext()) { 119 119 Way w = it.next(); 120 assert w.isUsable(); // Way is referrer of selected node(s) so it must be usable121 int last = w.getNodesCount() - 1;122 boolean circular = w.isClosed();123 124 120 for (Node n : selectedNodes) { 125 int i = w.getNodes().indexOf(n); 126 if (!(circular || (i > 0 && i < last))) { 121 if(!w.isInnerNode(n)) { 127 122 it.remove(); 128 123 continue WAY_LOOP; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r3468 r3515 407 407 } 408 408 409 public boolean isInnerNode(Node n) { 410 Node[] nodes = this.nodes; 411 if (isIncomplete() || nodes.length <= 2) return false; 412 /* circular ways have only inner nodes, so return true for them! */ 413 if (n == nodes[0] && n == nodes[nodes.length-1]) return true; 414 for(int i = 1; i < nodes.length - 1; ++i) { 415 if(nodes[i] == n) return true; 416 } 417 return false; 418 } 419 420 409 421 @Override 410 422 public String getDisplayName(NameFormatter formatter) {
Note:
See TracChangeset
for help on using the changeset viewer.