- Timestamp:
- 2010-08-14T21:31:31+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r3392 r3437 311 311 wayToAdd.setNodes(chunkIt.next()); 312 312 commandList.add(new AddCommand(layer,wayToAdd)); 313 //Main.debug("wayToAdd: " + wayToAdd);314 313 newSelection.add(wayToAdd); 315 314 … … 328 327 type = ""; 329 328 } 330 int i = 0; 331 329 330 int i_c = 0, i_r = 0; 332 331 List<RelationMember> relationMembers = r.getMembers(); 333 332 for (RelationMember rm: relationMembers) { … … 402 401 Boolean backwards = null; 403 402 int k = 1; 404 while (i - k >= 0 || i+ k < relationMembers.size()) {405 if ((i - k >= 0) && relationMembers.get(i- k).isWay()){406 Way w = relationMembers.get(i - k).getWay();403 while (i_r - k >= 0 || i_r + k < relationMembers.size()) { 404 if ((i_r - k >= 0) && relationMembers.get(i_r - k).isWay()){ 405 Way w = relationMembers.get(i_r - k).getWay(); 407 406 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 408 407 backwards = false; … … 412 411 break; 413 412 } 414 if ((i + k < relationMembers.size()) && relationMembers.get(i+ k).isWay()){415 Way w = relationMembers.get(i + k).getWay();413 if ((i_r + k < relationMembers.size()) && relationMembers.get(i_r + k).isWay()){ 414 Way w = relationMembers.get(i_r + k).getWay(); 416 415 if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) { 417 416 backwards = true; … … 424 423 } 425 424 426 int j = i ;425 int j = i_c; 427 426 for (Way wayToAdd : newWays) { 428 427 RelationMember em = new RelationMember(rm.getRole(), wayToAdd); 429 428 j++; 430 429 if ((backwards != null) && backwards) { 431 c.addMember(i , em);430 c.addMember(i_c, em); 432 431 } else { 433 432 c.addMember(j, em); 434 433 } 435 434 } 436 i = j;435 i_c = j; 437 436 } 438 437 } 439 i ++;438 i_c++; i_r++; 440 439 } 441 440
Note:
See TracChangeset
for help on using the changeset viewer.